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 please help need ASAP JAVA Name: Triangle2D.java (3 points) Instance Variables: Point2D] vertices (array that holds 3 Point2D objects) double area double perimeter

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

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!