> For the complete documentation index, see [llms.txt](https://yingshaoxo.gitbook.io/university-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yingshaoxo.gitbook.io/university-notes/high-level-math/gaokao/polar-coordinates.md).

# Polar Coordinates

To be honest, it should be called `Polar Coordinate System`

> In mathematics, the polar coordinate system is a two-dimensional coordinate system in which each point on a plane is determined by a distance from a reference point and an angle from a reference direction.

![](/files/-Lf5hkBVzuTLQ54OfmEA)

* The `reference point` (analogous to the origin of a Cartesian coordinate system, the center point) is called the `pole`
* The `ray` from the pole in the reference direction is the `polar axis`

You can represent any point in this system with `(distance, angle)`, for example, `(3, 60 degree)`

or generally, $$(\rho, \theta)$$

$$\rho$$: rho

$$\theta$$: theta

### Converting between polar and Cartesian coordinates

$$
x = \rho \cdot \cos{\theta}
$$

$$
y = \rho \cdot \sin{\theta}
$$

$$
\rho = \sqrt{x^2 + y^2}
$$

## Question and Answers

#### In polar coordinate system, a circle equation is $$\rho = 8 \cdot \sin{\theta}$$, a line equation is $$\theta=\frac{\pi}{3}$$, what's the max distance for a point at that circle to the line?

> the answer is 6

**First, we need to convert all information from polar coordinate to Cartesian coordinate:**

**1. circle**

$$
\begin{align\*}
\rho &= 8 \cdot \sin{\theta}
\\
\rho &= 8 \cdot \frac{y}{\rho}
\\
{\rho}^2 &= 8y
\\
x^2 + y^2 &= 8y
\\
x^2 + y^2 - 8y &= 0
\\
x^2 + (y-4)^2 &= 16 = 4^2
\\
\end{align\*}
$$

so now we know the center point of that circle is `(0, 4)`, radius of the circle is `4`

**2. line**

we know $$\theta=\frac{\pi}{3}$$ is nothing but a line of 60 degree angle.

And we also know a general line could be represented as $$y = slope \cdot x$$

And $$slope = \tan(\theta)$$

so:

$$
\begin{align\*}
slope &= \tan\frac{\pi}{3}
\\
&= \sqrt{3}
\ \\
y &= \sqrt{3} \cdot x
\\
\end{align\*}
$$

**How to get the max distance?**

Inner a circle, `diameter` is the longest line segment you can get.

> A special line drawn inside a circle is called a chord. A chord can be of different lengths. The longest length of the chord is called a diameter. Two times the radius makes a diameter.

And for the distance between a point($$x\_0, y\_0$$) and a line($$ax + by + c = 0$$), there's a formula for it:

$$
distance = \frac{|a(x\_0) + b(y\_0) + c|}{\sqrt{a^2 + b^2}}
$$

So first, we need to choose a line as close a diameter as possible.

For some reason, people already known `the distance between a line and circle center` + `the radius of that circle` = `the max distance for a point at that circle to the line`.

so:

$$
\begin{align\*}
\text{distance between circle center and line} &= \frac{|\sqrt{3} \cdot 0 + (-1) \cdot (-4)|}{\sqrt{\sqrt{3}^2 + 1^2}}
\\
&= \frac{4}{2}
\\
&= 2
\ \\
\text{max distance} &= 4 + \text{radius of that circle}
\\
\text{max distance} &= 4 + 2
\\
\text{max distance} &= 6
\end{align\*}
$$

Thank you for reading, I love the feeling of doing this.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://yingshaoxo.gitbook.io/university-notes/high-level-math/gaokao/polar-coordinates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
