Java examples for Algorithm:Geometry
Cartesian To Polar Coordinate
public class CartesianToPolar { public static void main(String args[]) { double x = 12; double y = 5; double r = Math.sqrt(x * x + y * y); System.out.println("r is " + r); double thetha = Math.toDegrees(Math.atan2(y, x)); System.out.println("thetha is " + thetha); }// w w w .j a v a 2 s.com }