package ῲ.ᓆ;

import android.graphics.Matrix;
import android.graphics.Path;
import android.graphics.PathMeasure;

/* renamed from: ῲ.ᓆ.ⁱ  reason: contains not printable characters */
/* compiled from: PatternPathMotion */
public class C1657 extends AbstractC1672 {

    /* renamed from: ῲ  reason: contains not printable characters */
    public final Matrix f5896 = new Matrix();

    /* renamed from: K  reason: contains not printable characters */
    public final Path f5897 = new Path();

    public C1657(Path path) {
        PathMeasure pathMeasure = new PathMeasure(path, false);
        float[] fArr = new float[2];
        pathMeasure.getPosTan(pathMeasure.getLength(), fArr, null);
        float f = fArr[0];
        float f2 = fArr[1];
        pathMeasure.getPosTan(0.0f, fArr, null);
        float f3 = fArr[0];
        float f4 = fArr[1];
        if (f3 == f && f4 == f2) {
            throw new IllegalArgumentException("pattern must not end at the starting point");
        }
        this.f5896.setTranslate(-f3, -f4);
        float f5 = f - f3;
        float f6 = f2 - f4;
        float r1 = 1.0f / m4249(f5, f6);
        this.f5896.postScale(r1, r1);
        this.f5896.postRotate((float) Math.toDegrees(-Math.atan2((double) f6, (double) f5)));
        path.transform(this.f5896, this.f5897);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static float m4249(float f, float f2) {
        return (float) Math.sqrt((double) ((f2 * f2) + (f * f)));
    }

    @Override // ῲ.ᓆ.AbstractC1672
    public Path getPath(float f, float f2, float f3, float f4) {
        float f5 = f3 - f;
        float f6 = f4 - f2;
        float sqrt = (float) Math.sqrt((double) ((f6 * f6) + (f5 * f5)));
        double atan2 = Math.atan2((double) f6, (double) f5);
        this.f5896.setScale(sqrt, sqrt);
        this.f5896.postRotate((float) Math.toDegrees(atan2));
        this.f5896.postTranslate(f, f2);
        Path path = new Path();
        this.f5897.transform(this.f5896, path);
        return path;
    }
}
