1public static double[] pol(double x, double y) {
2 //return new double[]{Math.sqrt(x * x + y * y), Math.atan2(y, x)}; //red
3 return new double[]{Math.sqrt(x * x + y * y), (Math.atan2(y, x) * 180) / Math.PI}; //cart
4}
1static double[] cari(double r, double theta) {
2 theta = (theta / 180) * Math.PI;
3 return new double[]{r * Math.cos(theta), r * Math.sin(theta)};
4}