package o;

import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class T70 extends X70 {
    public final V70 c;
    public final float d;
    public final float e;

    public T70(V70 v70, float f, float f2) {
        this.c = v70;
        this.d = f;
        this.e = f2;
    }

    @Override // o.X70
    public final void a(Matrix matrix, J70 j70, int i, Canvas canvas) {
        V70 v70 = this.c;
        float f = v70.c;
        float f2 = this.e;
        float f3 = v70.b;
        float f4 = this.d;
        RectF rectF = new RectF(0.0f, 0.0f, (float) Math.hypot(f - f2, f3 - f4), 0.0f);
        Matrix matrix2 = this.a;
        matrix2.set(matrix);
        matrix2.preTranslate(f4, f2);
        matrix2.preRotate(b());
        j70.getClass();
        rectF.bottom += i;
        rectF.offset(0.0f, -i);
        int i2 = j70.f;
        int[] iArr = J70.i;
        iArr[0] = i2;
        iArr[1] = j70.e;
        iArr[2] = j70.d;
        Paint paint = j70.c;
        float f5 = rectF.left;
        paint.setShader(new LinearGradient(f5, rectF.top, f5, rectF.bottom, iArr, J70.j, Shader.TileMode.CLAMP));
        canvas.save();
        canvas.concat(matrix2);
        canvas.drawRect(rectF, paint);
        canvas.restore();
    }

    public final float b() {
        V70 v70 = this.c;
        return (float) Math.toDegrees(Math.atan((v70.c - this.e) / (v70.b - this.d)));
    }
}
