## Detecting clicks on lines Find the distance from a point to the line, and see if it is below a tolerance value. See [stack overflow](https://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment) Summarised at: DistanceFromPointToLine1 ## Detecting clicks within a polygon * [geeks for geeks](https://www.geeksforgeeks.org/how-to-check-if-a-given-point-lies-inside-a-polygon/)