python please Write a class called Point that represents a point in 2D plane. - The constructor accepts the x and y dimensions of the point. - Provide a method getX that returns the x coordinate of a point, and another method getY that returns the y coordinate of a point. - Provide a method called translate that changes the original coordinates of the point by adding a given values for x and y coordinates. - Provide a method distanceTo that calculates the distance between that point and another one. Use this equation to calculate the Distance math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)) While the math is a library you should import. Where the (x1, y) is the coordinates of the first point and (x2, y2) is the coordinates of the second point The output should be like this screenshot.
python please
Write a class called Point that represents a point in 2D plane.
- The constructor accepts the x and y dimensions of the point.
- Provide a method getX that returns the x coordinate of a point, and another method getY
that returns the y coordinate of a point.
- Provide a method called translate that changes the original coordinates of the point by
adding a given values for x and y coordinates.
- Provide a method distanceTo that calculates the distance between that point and another
one.
Use this equation to calculate the Distance math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))
While the math is a library you should import. Where the (x1, y) is the coordinates of the first point
and (x2, y2) is the coordinates of the second point
The output should be like this screenshot.
Step by step
Solved in 3 steps with 2 images