Question: please help need ASAP JAVA Name: Triangle2D.java (3 points) Instance Variables: Point2D ] vertices (array that holds 3 Point2D objects) double area double perimeter (3
please help need ASAP
JAVA 
![] vertices (array that holds 3 Point2D objects) double area double perimeter](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f31c1a8126d_47466f31c1a02c9a.jpg)
Name: Triangle2D.java (3 points) Instance Variables: Point2D ] vertices (array that holds 3 Point2D objects) double area double perimeter (3 points each) Constructors: Triangle2D(Point2D vertex1, Point2D vertex2, Point2D vertex3) Triangle2D0 (3 points each) Methods: calculateArea() returns a double calculatePerimeter() returns a double getPoints() returns an array of Point2D objects setPoints(Point2D [ verts): this will set up all the points HINT: This would be how to set up the first point: this.vertices[0].setX(verts[0].getX(0); this.vertices[0].setY(verts[0].getY()); toString(: "The vertices of this triangle are: (a,b),(c,d),(e,f) " Where (a,b) is the first point, (c,d) is the second point and (e,f) is th compare(Object otherObj): This will return true of 2 triangles have and PERIMETER Helpful formula: Area of a triangle given 3 vertices: 2Ax(ByCy)+Bx(CyAy)+Cx(AyBy) Where A,B, and C are vertices of the triangle. Ax= the x coordinate of A Ay= the y coordinate of A Bx= the x coordinate of B By = the y coordinate of B Cx= the x coordinate of C Cy= the y coordinate of C Name: Triangle2D.java (3 points) Instance Variables: Point2D ] vertices (array that holds 3 Point2D objects) double area double perimeter (3 points each) Constructors: Triangle2D(Point2D vertex1, Point2D vertex2, Point2D vertex3) Triangle2D0 (3 points each) Methods: calculateArea() returns a double calculatePerimeter() returns a double getPoints() returns an array of Point2D objects setPoints(Point2D [ verts): this will set up all the points HINT: This would be how to set up the first point: this.vertices[0].setX(verts[0].getX(0); this.vertices[0].setY(verts[0].getY()); toString(: "The vertices of this triangle are: (a,b),(c,d),(e,f) " Where (a,b) is the first point, (c,d) is the second point and (e,f) is th compare(Object otherObj): This will return true of 2 triangles have and PERIMETER Helpful formula: Area of a triangle given 3 vertices: 2Ax(ByCy)+Bx(CyAy)+Cx(AyBy) Where A,B, and C are vertices of the triangle. Ax= the x coordinate of A Ay= the y coordinate of A Bx= the x coordinate of B By = the y coordinate of B Cx= the x coordinate of C Cy= the y coordinate of C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
