mirror of
https://github.com/QM4RS/FridaBox.git
synced 2026-10-22 07:42:18 +02:00
feat: Enhance core framework with improved service faking, package management, and build system updates.
intigrated disable flag secure remove comments cleanup codes
This commit is contained in:
@@ -8,44 +8,23 @@ public class MathUtil {
|
||||
public MathUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the distance between two points.
|
||||
*
|
||||
* @param A Point A
|
||||
* @param B Point B
|
||||
* @return the distance between point A and point B.
|
||||
*/
|
||||
|
||||
public static int getDistance(PointF A, PointF B) {
|
||||
return (int) Math.sqrt(Math.pow(A.x - B.x, 2) + Math.pow(A.y - B.y, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the distance between two points.
|
||||
*/
|
||||
|
||||
public static int getDistance(float x1, float y1, float x2, float y2) {
|
||||
return (int) Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the coordinates of a point on the line by cut length.
|
||||
*
|
||||
* @param A Point A
|
||||
* @param B Point B
|
||||
* @param cutLength cut length
|
||||
* @return the point.
|
||||
*/
|
||||
|
||||
public static Point getPointByCutLength(Point A, Point B, int cutLength) {
|
||||
float radian = getRadian(A, B);
|
||||
return new Point(A.x + (int) (cutLength * Math.cos(radian)), A.y + (int) (cutLength * Math.sin(radian)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the radian between current line(determined by point A and B) and horizontal line.
|
||||
*
|
||||
* @param A point A
|
||||
* @param B point B
|
||||
* @return the radian
|
||||
*/
|
||||
|
||||
public static float getRadian(Point A, Point B) {
|
||||
float lenA = B.x - A.x;
|
||||
float lenB = B.y - A.y;
|
||||
@@ -56,22 +35,12 @@ public class MathUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* angle to radian
|
||||
*
|
||||
* @param angle angle
|
||||
* @return radian
|
||||
*/
|
||||
|
||||
public static double angle2Radian(double angle) {
|
||||
return angle / 180 * Math.PI;
|
||||
}
|
||||
|
||||
/**
|
||||
* radian to angle
|
||||
*
|
||||
* @param radian radian
|
||||
* @return angle
|
||||
*/
|
||||
|
||||
public static double radian2Angle(double radian) {
|
||||
return radian / Math.PI * 180;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user