Question: java 1) Complete the following programming assignment: Design & implement a class called Point that can be used to keep track of a location in

java java 1) Complete the following programming assignment: Design & implement a class

1) Complete the following programming assignment: Design & implement a class called Point that can be used to keep track of a location in the Cartesian plane. Include (at a minimum) the following methods: shiftX(n),shiftY(n) shift a point by a given amount along one of the axes swap () which swaps the values of the x & y coordinates distance () & distance (p2) finds the distance to the point p2 or the origin if no point given. rotate (Angle) rotates the point by a specified angle around the origin. The formula for rotation is as follows: x' = x cos(O) y sin(O) y' = x sin(O) + y cos(O) any other methods you believe to be necessary. 2) Write a toString () method for your Point class that displays the coordinates of the point as an ordered pair, eg (3,2) 3) Create a driver class that demonstrates that your methods produce the correct output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!