Question: Write a class that keeps track of a point in polar coordinates. A point in polar coordinates has a length L and an angle Theta.

Write a class that keeps track of a point in polar coordinates. A point in polar coordinates has a length L and an angle Theta. Make sure to include

  • A default constructor that sets the length to one and the angle to zero.
  • A constructor that has a length and an angle parameter.
  • Remember to reduce an angle larger than 360 to under 360.
    • 400 degrees 40 degrees
    • 730 degrees 10 degrees
  • An overloaded * operator that multiplies two points together.
    • To multiply polar coordinates, you need to multiply the lengths together and add the angles.
      • Example : (4 @ 100 degrees) * (5 @ 30 degrees) = (20 @ 130 degrees)
      • Remember to reduce an angle larger than 360 to under 360 as above.
  • An overloaded == operator that compares the length and degrees for equality.

Upload the necessary Files for your class. I do not need a testing program.

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!