The cartesian plane represents a two-dimensional space (in 2 dimensions), formed by two perpendicular lines, one horizontal
Fantastic news! We've Found the answer you've been seeking!
Question:
points and coordinates
The representation of a point is simple: P(X,Y) where X and Y are the horizontal distance (left or right) and vertical distance (up or down) respectively, using the point of origin (0,0) as a reference, Right in the center of the plane.
Vectors in the plane
A vector in the plane refers to an oriented segment, generated from two distinct points. Given the relevant explanations, the following should be done:
• 1. Create the class called Point with its two coordinates X and Y.
• 2. Add a constructor method to easily create points. If a coordinate is not received, its value will be zero.
• 3. Overwrite the string method, so that when printing on the screen a point appears in (X,Y) format.
• 4. Add a method called quadrant that indicates which quadrant the point belongs to, taking into account that if X == 0 and Y != 0 it is located on the Y axis, if X != 0 and Y == 0 it is located about the X axis and if X == 0 and Y == 0 is about the origin.
• 5. Add a method called vector, which takes another point and calculates the resulting vector between the two points.
• 6. Add a method called distance, which takes another point and calculates the distance between the two points and displays it on the screen. The formula is as follows.
• 7. Create the class called Quadrilateral with two points (start and end) that will form the diagonal of the quadrilateral.
• 8. Add a constructor method to easily create both points, if they are not sent two points will be created at the origin by default.
• 9. Add to the quadrilateral a method called base that displays the base.
• 10. Add to the quadrilateral a method called height that displays the height.
• 11. Add to the quadrilateral a method called area that displays the area.
• 12. Add to the quadrilateral a method called isSquare that shows if it is a square or not.
• 13. Create the class called Triangle with 3 points (x, y, z) that will form the triangle.
• 14. Add a constructor method to create the points easily, if they are not sent, three points will be created at the origin by default.
• 15. Add to the triangle a method called area that displays the area.
Related Book For
Posted Date: