public static void cartesianToPolar(Graph graph, ArrayList vertices) {
		double theta, r;
		Point2D cartesian;
		for (int i=0; i<vertices.size(); i++) {
			cartesian = graph.pointForVertex(vertices.get(i));
			if (cartesian.getY() != 0)
				theta = Math.atan(cartesian.getY() / cartesian.getX());
			else
				theta = Math.PI / 2;
			r = Math.sqrt(Math.pow(cartesian.getX(), 2) + Math.pow(cartesian.getY(), 2));
			graph.moveVertex(vertices.get(i), new Point2D.Double(r, theta));			
		}
	}