# Geometry

## Techniques

### Check if point is inside polygon

Otherwise known to be raycasting, crossing number algorithm, or the even-odd rule algorithm

* From point $$(x, y)$$, draw a line infinitely long in 1 direction and check how many sides of the polygon it intersects
  * If intersect odd number of points, inside polygon
  * Otherwise, outside of polygon
* Ensure to check for corner pieces such as `L` and `7` pieces and do not count those


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://interviews.woojiahao.com/algorithms/geometry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
