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 }
static double[] cari(double r, double theta) { theta = (theta / 180) * Math.PI; return new double[]{r * Math.cos(theta), r * Math.sin(theta)}; }