📜  java笛卡尔到极坐标 - Java代码示例

📅  最后修改于: 2022-03-11 14:52:31.694000             🧑  作者: Mango

代码示例1
public static double[] pol(double x, double y) {
    //return new double[]{Math.sqrt(x * x + y * y), Math.atan2(y, x)}; //red
    return new double[]{Math.sqrt(x * x + y * y), (Math.atan2(y, x) * 180) / Math.PI}; //cart
}