이 소스가 무슨 용도로 쓰이는지 알 수 있을까요??;;;
class MixUtils {
public static String parseAction(String action) {
return (action.substring(action.indexOf(':') + 1, action.length()))
.trim();
}
public static String formatDist(float meters) {
if (meters < 1000) {
return ((int) meters) + "m";
} else if (meters < 10000) {
return formatDec(meters / 1000f, 1) + "km";
} else {
return ((int) (meters / 1000f)) + "km";
}
}
static String formatDec(float val, int dec) {
int factor = (int) Math.pow(10, dec);
int front = (int) (val );
int back = (int) Math.abs(val * (factor) ) % factor;
return front + "." + back;
}
public static boolean pointInside(float P_x, float P_y, float r_x,
float r_y, float r_w, float r_h) {
return (P_x > r_x && P_x < r_x + r_w && P_y > r_y && P_y < r_y + r_h);
}
public static float getAngle(float center_x, float center_y, float post_x,
float post_y) {
float tmpv_x = post_x - center_x;
float tmpv_y = post_y - center_y;
float d = (float) Math.sqrt(tmpv_x * tmpv_x + tmpv_y * tmpv_y);
float cos = tmpv_x / d;
float angle = (float) Math.toDegrees(Math.acos(cos));
angle = (tmpv_y < 0) ? angle * -1 : angle;
return angle;
}
}




formatDist 라는 함수는 미터 단위를 입력받아서 미터나 킬로미터 단위로 바꿔서 리턴해주는 함수인것 같네요.
formatDec 이건 뭐하는건지 잘 모르겠네요.
pointInside 이건 3차원 좌표를 2개를 입력받아서 안에 있는지 여부를 판단하는것 같네용