(Geometry: The Triangle2D class) Define the Triangle2D class that contains:
(Hint: For the formula to compute the area of a triangle, see Programming Exercise 2.15. Use the java.awt.geo.Line2D class in the Java API to implement the contains and overlaps methods. The Line2D class contains the methods for checking whether two line segments intersect and whether a line contains a point, and so on. Please see the Java API for more information on Line2D. To detect whether a point is inside a triangle, draw three dashed lines, as shown in Figure 10.17. If the point is inside a triangle, each dashed line should intersect a side only once. If a dashed line intersects a side twice, then the point must be outside the triangle.)
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.