> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/swiftui/shapes/circle-to-star.md).

# 正圓變成正五邊形

[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 %}
