Create a class Polar that represents the points on the plain as polar coordinates (radius and angle).
Create an overloaded +operator for addition of two Polar quantities. “Adding” two points on the
plain can be accomplished by adding their X coordinates and then adding their Y coordinates.
This gives the X and Y coordinates of the “answer.” Thus you’ll need to convert two sets of polar
coordinates to rectangular coordinates, add them, and then convert the resulting rectangular
representation back to polar.
Answers
Answered by
3
Answer:
The problem asks the user to input the coordinates of two cartesian points, converts them to polar coordinates and add the two polar coordinates (& print results of each step.
The only problem I have with this code is in adding the two polar points (I tried storing it as a static function but it still gave me the same result). The conversion to polar points works fine; its only the addition that is giving the wrong results
Formula for adding two polar coordinates
Theta= 0.5(theta1+theta2)
radius=sqrt(r1^2 +r2^2+ (2*r1*r2*cos(theta2-theta1))
Similar questions