#fs
lsh
2024-09-10 396123603febc184ac16d2a28ae72a2df716d776
src/main/java/com/zy/asrs/utils/Utils.java
@@ -87,5 +87,27 @@
        return new double[]{x,y};
    }
    public static double[] RingThroughXY2(double a,double b) {
        double l = b / a;
        // 圆的已知参数
        double radius = 48; // 半径为48
//        double circumference = ; // 计算圆周长
        double arcLength = 2 * Math.PI * radius * l; // 给出的弧长
        // 圆心坐标
        double centerX = 51;
        double centerY = 49;
        // 求弧度
        double theta = arcLength / radius;
        // 计算点的坐标
        double x = 100-(centerX + radius * Math.cos(theta));
        double y = centerY + radius * Math.sin(theta);
        return new double[]{x, y};
    }
}