Question: Write a program that draws a fixed polygon with points at (40, 20), (70, 40), (60, 80), (45, 45), and (20, 60). Whenever the mouse
Write a program that draws a fixed polygon with points at (40, 20), (70, 40), (60, 80), (45, 45), and (20, 60). Whenever the mouse is moved, display a message indicating whether the mouse point is inside the polygon at the mouse point or outside of it, as shown in Figure 15.27c. To detect whether a point is inside a polygon, use the contains method defined in the Node class.
Mouse point is outside the polygon (c)
Step by Step Solution
3.48 Rating (174 Votes )
There are 3 Steps involved in it
Program Plan The program defines a UI for the user polygon with defined dimensions that is placed at ... View full answer
Get step-by-step solutions from verified subject matter experts
