QuestionQuestion

Given the following set of X,Y points

X Y
86.92 2.47
70.93 27.81
97.74 34.36
30.90 35.14
51.66 31.70
0.830 21.77
55.91 66.62
32.92 75.23
65.26 72.53
83.90 4.710

Develop a Cartesian class which can convert Polar to Cartesian in a constructor and determine the distance between two Cartesian points in a method. Use it to determine the total distance from the first to the last point.

Develop a Polar class which can convert Cartesian to Polar in a constructor and determine the distance between two Polar points in a method. A single instance of Polar only has a Rho and Theta and likewise a single instance of Cartesian only has an X and Y. The Polar coordinates should go from [-pi, pi]. Use it to convert each of the Cartesian points to Polar and then determine the total distance through all points from the first to the last point.

Include the following sections with your submission:

Reqts – A text description of what is performed
Design – A text or preferably graphical depiction of how it is performed

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public class Cartesian {

//Declare cartesian using polar coordinates
public Cartesian(double theta, double rho)
{
x = rho * Math.cos(theta);
y = rho * Math.sin(theta);
}
//Declare cartesian point using cartesian coordinates, uses boolean just to differentiate the two constructors
public Cartesian(double x, double y, boolean cartesian)
{
this.x = x;
this.y = y;
}
//Set X value for coordinate
public void setX(double x)
{
this.x = x;
}
//Set Y value for coordinate
public void setY(double y)
{
this.y = y;
}
//Get X value of coordinate...
$20.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats