CodeGym /Courses /Java Collections /Tasks | Level 10 | Lesson 6

Tasks | Level 10 | Lesson 6

Java Collections
Level 10, Lesson 6
Available
20
Task
Java Collections, level 10, lesson 6
Locked
Sending an email with a file attachment
Sending an email with a file attachment
20
Task
Java Collections, level 10, lesson 6
Locked
Points in a polygon
Points in a polygon
Comments (5)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Justin Smith Level 41, Greenfield, USA, United States
12 June 2023
The second one was one of my favorite tasks of the entire course!
Denys Pits Level 41, Ukraine
24 April 2021
Read about Polygon class. It will be much easier to complete the task with a point
Justin Smith Level 41, Greenfield, USA, United States
12 June 2023
You can do this but honestly I found it much more interesting and rewarding to calculate it mathematically, and the code is not terribly complicated in doing so. If you decide to do it mathematically as I did, the main crux is understanding that a line that extends from the point in any direction infinitely will encounter an odd number of intersections if it is inside the polygon, and an even number of intersections if it is outside the polygon.
matemate123 Level 50, Kraków, Poland
16 December 2023
Can you send me your solution? It's an interesting problem. I've been thinking about it for some time, but I'm not an expert in math.
Denys Pits Level 41, Ukraine
24 April 2021
javax:javaee-api:8.0.1 Add this library from Maven in the Intellij