Answers for "java cartesian to polar"

2

java cartesian to polar

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
}
Posted by: Guest on January-06-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language