#
luxiaotao1123
2024-05-08 9f1744708955e2f14284925c20d12ad0486c3f30
src/utils/common.js
@@ -28,6 +28,21 @@
    return (targetTheta - originTheta > 180) ? targetTheta - 360 : targetTheta;
}
export const positiveAngle = (angle) => {
    return ((angle % 360) + 360) % 360;
}
export const normalizeAngle = (angle) => {
    let newAngle = angle % 360;
    if (newAngle < -180) {
        newAngle += 360;
    } else if (newAngle > 180) {
        newAngle -= 360;
    }
    return newAngle;
}
export const calculateMappedPosition = (realPos) => {
    return [
        realPos[0] * REAL_COMPARE_MAP_SCALE + REAL_COMPARE_MAP_OFFSET_X,