# 正圓變成正五邊形

[SwiftUI](/ios/swiftui.md) ⟩ shapes ⟩ circle to pentagon&#x20;

{% hint style="success" %}
用<mark style="color:orange;">極方程式</mark>表示<mark style="color:yellow;">正五邊形</mark>。
{% endhint %}

{% tabs %}
{% tab title="🗺️ 圖表" %}
{% embed url="<https://www.desmos.com/calculator/kuqibrzush>" %}
正五邊形的極方程式
{% endembed %}

:point\_right: <https://www.desmos.com/calculator/kuqibrzush>
{% endtab %}

{% tab title="📐 數學式" %}

* 頂點所在的角度： $$v\[i]=\frac{2\pi}{5}(i-1)$$，其中 $$i=1 \dots 5$$
* 各邊中垂線角度： $$a\[i]=v\[i]+\frac{\pi}{5}$$
* 標準位置上的正五邊形極方程式：

$$
r =
\begin{cases}
\dfrac{R \cos(\frac{\pi}{5})}{\cos(\theta - a\[1])} & \text{if } \ v\[1] \le x < v\[2] \ \\
\dfrac{R \cos(\frac{\pi}{5})}{\cos(\theta - a\[2])} & \text{if } \ v\[2] \le x < v\[3] \ \\
\dfrac{R \cos(\frac{\pi}{5})}{\cos(\theta - a\[3])} & \text{if } \ v\[3] \le x < v\[4] \ \\
\dfrac{R \cos(\frac{\pi}{5})}{\cos(\theta - a\[4])} & \text{if } \ v\[4] \le x < v\[5] \ \\
\dfrac{R \cos(\frac{\pi}{5})}{\cos(\theta - a\[5])} & \text{if } \ v\[5] \le x < v\[1]+2 \pi
\end{cases}
$$

<figure><img src="/files/u5oKnJYg040O9lsQE1u3" alt=""><figcaption></figcaption></figure>

{% endtab %}

{% tab title="📗 參考" %}

* ChatGPT ⟩ [正五邊形的極方程式](https://chatgpt.com/share/675cbe68-d0cc-800e-a64d-6918e848abdb) (裡面的公式雖然不正確，但方向正確)
  {% endtab %}
  {% endtabs %}


---

# 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://lochiwei.gitbook.io/ios/swiftui/shapes/circle-to-star.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.
