81 lines
2.5 KiB
Java
81 lines
2.5 KiB
Java
package com.google.zxing;
|
|
|
|
import com.google.zxing.common.detector.MathUtils;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ResultPoint {
|
|
private final float a;
|
|
private final float b;
|
|
|
|
public ResultPoint(float f, float f2) {
|
|
this.a = f;
|
|
this.b = f2;
|
|
}
|
|
|
|
public final float a() {
|
|
return this.a;
|
|
}
|
|
|
|
public final float b() {
|
|
return this.b;
|
|
}
|
|
|
|
public final boolean equals(Object obj) {
|
|
if (obj instanceof ResultPoint) {
|
|
ResultPoint resultPoint = (ResultPoint) obj;
|
|
if (this.a == resultPoint.a && this.b == resultPoint.b) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return (Float.floatToIntBits(this.a) * 31) + Float.floatToIntBits(this.b);
|
|
}
|
|
|
|
public final String toString() {
|
|
return "(" + this.a + ',' + this.b + ')';
|
|
}
|
|
|
|
public static void a(ResultPoint[] resultPointArr) {
|
|
ResultPoint resultPoint;
|
|
ResultPoint resultPoint2;
|
|
ResultPoint resultPoint3;
|
|
float a = a(resultPointArr[0], resultPointArr[1]);
|
|
float a2 = a(resultPointArr[1], resultPointArr[2]);
|
|
float a3 = a(resultPointArr[0], resultPointArr[2]);
|
|
if (a2 >= a && a2 >= a3) {
|
|
resultPoint = resultPointArr[0];
|
|
resultPoint2 = resultPointArr[1];
|
|
resultPoint3 = resultPointArr[2];
|
|
} else if (a3 < a2 || a3 < a) {
|
|
resultPoint = resultPointArr[2];
|
|
resultPoint2 = resultPointArr[0];
|
|
resultPoint3 = resultPointArr[1];
|
|
} else {
|
|
resultPoint = resultPointArr[1];
|
|
resultPoint2 = resultPointArr[0];
|
|
resultPoint3 = resultPointArr[2];
|
|
}
|
|
if (a(resultPoint2, resultPoint, resultPoint3) < 0.0f) {
|
|
ResultPoint resultPoint4 = resultPoint3;
|
|
resultPoint3 = resultPoint2;
|
|
resultPoint2 = resultPoint4;
|
|
}
|
|
resultPointArr[0] = resultPoint2;
|
|
resultPointArr[1] = resultPoint;
|
|
resultPointArr[2] = resultPoint3;
|
|
}
|
|
|
|
public static float a(ResultPoint resultPoint, ResultPoint resultPoint2) {
|
|
return MathUtils.a(resultPoint.a, resultPoint.b, resultPoint2.a, resultPoint2.b);
|
|
}
|
|
|
|
private static float a(ResultPoint resultPoint, ResultPoint resultPoint2, ResultPoint resultPoint3) {
|
|
float f = resultPoint2.a;
|
|
float f2 = resultPoint2.b;
|
|
return ((resultPoint3.a - f) * (resultPoint.b - f2)) - ((resultPoint3.b - f2) * (resultPoint.a - f));
|
|
}
|
|
}
|