package xr;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PointF;
import android.graphics.RectF;
import android.view.View;
import vr.c;
import vr.d;
import vr.f;

/* loaded from: classes5.dex */
public class a extends c {

    /* renamed from: c, reason: collision with root package name */
    Paint f51034c;

    /* renamed from: d, reason: collision with root package name */
    int f51035d;

    /* renamed from: e, reason: collision with root package name */
    float f51036e;

    /* renamed from: f, reason: collision with root package name */
    float f51037f;

    /* renamed from: g, reason: collision with root package name */
    float f51038g;

    /* renamed from: h, reason: collision with root package name */
    int f51039h;

    /* renamed from: i, reason: collision with root package name */
    PointF f51040i;

    /* renamed from: j, reason: collision with root package name */
    RectF f51041j;

    /* renamed from: k, reason: collision with root package name */
    Path f51042k;

    public a() {
        Paint paint = new Paint();
        this.f51034c = paint;
        paint.setAntiAlias(true);
        this.f51040i = new PointF();
        this.f51041j = new RectF();
        this.f51042k = new Path();
    }

    private float m(float f10, float f11, float f12) {
        return f12 + (f11 * ((float) Math.cos(Math.toRadians(f10))));
    }

    private float n(float f10, float f11, float f12) {
        return f12 + (f11 * ((float) Math.sin(Math.toRadians(f10))));
    }

    @Override // vr.c
    public PointF a(float f10, float f11) {
        float width = this.f51041j.width() + f11;
        return new PointF(m(f10, width, this.f51041j.centerX()), n(f10, width, this.f51041j.centerY()));
    }

    @Override // vr.c
    public boolean b(float f10, float f11) {
        return f.f(f10, f11, this.f51040i, this.f51036e);
    }

    @Override // vr.c
    public void c(Canvas canvas) {
        if (this.f40485a) {
            int alpha = this.f51034c.getAlpha();
            int color = this.f51034c.getColor();
            if (color == 0) {
                this.f51034c.setColor(-1);
            }
            this.f51034c.setAlpha(this.f51035d);
            PointF pointF = this.f51040i;
            canvas.drawCircle(pointF.x, pointF.y, this.f51038g, this.f51034c);
            this.f51034c.setColor(color);
            this.f51034c.setAlpha(alpha);
        }
        canvas.drawPath(e(), this.f51034c);
    }

    @Override // vr.c
    public RectF d() {
        return this.f51041j;
    }

    @Override // vr.c
    public Path e() {
        return this.f51042k;
    }

    @Override // vr.c
    public void f(d dVar, float f10, float f11) {
        PointF pointF = this.f51040i;
        pointF.x = f10;
        pointF.y = f11;
        RectF rectF = this.f51041j;
        float f12 = this.f51037f;
        rectF.left = f10 - f12;
        rectF.top = f11 - f12;
        rectF.right = f10 + f12;
        rectF.bottom = f11 + f12;
    }

    @Override // vr.c
    public void g(d dVar, View view, int[] iArr) {
        view.getLocationInWindow(new int[2]);
        f(dVar, (r1[0] - iArr[0]) + (view.getWidth() / 2), (r1[1] - iArr[1]) + (view.getHeight() / 2));
    }

    @Override // vr.c
    public void h(int i10) {
        this.f51034c.setColor(i10);
        int alpha = Color.alpha(i10);
        this.f51039h = alpha;
        this.f51034c.setAlpha(alpha);
    }

    @Override // vr.c
    public void k(d dVar, float f10, float f11) {
        this.f51034c.setAlpha((int) (this.f51039h * f11));
        this.f51036e = this.f51037f * f10;
        Path path = new Path();
        this.f51042k = path;
        PointF pointF = this.f51040i;
        path.addCircle(pointF.x, pointF.y, this.f51036e, Path.Direction.CW);
    }

    @Override // vr.c
    public void l(float f10, float f11) {
        this.f51038g = this.f51037f * f10;
        this.f51035d = (int) (this.f40486b * f11);
    }

    public a o(float f10) {
        this.f51037f = f10;
        return this;
    }
}
