/** This is a main Driver which controls the two other classes: Cartesian and Polar. * By creating two object instances, i can call the other classes' method to process * Values from XY to Polar and from Polar to XY with its respected Distances. * * http://www.mathsisfun.com/polar-cartesian-coordinates.html * * @author Freeman Lo * @version 0.0.1 Build 1 Feb 1, 2014. * Limitations - Besides not having try-catch error handling blocks * Everything else seem to work pretty well, it is a standalone software * with embedded values in each Cartesian and Polar class. * */ import java.io.*; import java.util.*; import java.lang.*; // Class Main public class HW3Main { public static void main(String [] args) throws IOException { System.out.println("-- Polar values --"); Polar pol = new Polar(); // creating an polar instance pol.addXY(); // add XY values to arraylist pol.calRho(); // compute Rho value pol.calTheta(); // compute Theta value pol.printRhoThetaValues(); // print each of the Rho/theta values as a pair to stdout pol.calDistance(); // compute Distance with Rho and Theta Values pol.printDistanceResults(); // print out distances to stdout System.out.println(); // spacing System.out.println(); // spacing System.out.println("-- Cartesian Values --"); Cartesian cart = new Cartesian(); cart.addPolar(); cart.calX(); cart.calY(); cart.printXYValues(); cart.calDistance(); cart.printDistanceResults(); } }