「五角形」をwolframalphaとsympyで作図

オリジナル

https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q13107300298

# 参考

https://ja.wikipedia.org/wiki/%E4%BA%94%E8%A7%92%E5%BD%A2

https://ja.wikipedia.org/wiki/%E4%BA%94%E8%8A%92%E6%98%9F

芒（のぎ）

https://www.google.com/search?q=%E8%8A%92&rlz=1C1CHBD_jaJP908JP908&oq=%E8%8A%92&aqs=chrome..69i57j0i433i512j0i512l2j0i433i512j0i512j0i131i433i512j69i60.808j0j7&sourceid=chrome&ie=UTF-8

https://en.wikipedia.org/wiki/Pentagon

https://en.wikipedia.org/wiki/Pentagram

紙片の結び目と正五角形,止め結び（とめむすび、英: Overhand knot）

https://ja.wikipedia.org/wiki/%E4%BA%94%E8%A7%92%E5%BD%A2#%E3%81%9D%E3%81%AE%E4%BB%96%E4%BA%94%E8%A7%92%E5%BD%A2%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E4%BA%8B%E9%A0%85

https://en.wikipedia.org/wiki/Overhand_knot#In_paper-folding

https://ja.wikipedia.org/wiki/%E6%AD%A2%E3%82%81%E7%B5%90%E3%81%B3

五芒星のDXFファイルを生成

https://qiita.com/Butterthon/items/244f08bd9b9cea10f643


wolframalphaで

https://www.wolframalpha.com/input?i=%E6%AD%A3%E4%BA%94%E8%A7%92%E5%BD%A2&lang=ja

https://www.wolframalpha.com/input?i=%E4%BA%94%E8%A7%92%E5%BD%A2&lang=ja


# wolframalphaで作図(sympy経由)

```python 
from sympy import *
t=(2*pi)/5
A=Point(cos(pi/2+t*2),sin(pi/2+t*2))
B=Point(cos(pi/2+t*3),sin(pi/2+t*3))
C=Point(cos(pi/2+t*4),sin(pi/2+t*4))
D=Point(cos(pi/2+t*0),sin(pi/2+t*0))
E=Point(cos(pi/2+t*1),sin(pi/2+t*1))
print("Polygon[{",A.x,",",A.y,"},",
              "{",B.x,",",B.y,"},",
              "{",C.x,",",C.y,"},",
              "{",D.x,",",D.y,"},",
              "{",E.x,",",E.y,"},",
              "{",A.x,",",A.y,"}" 
             "]")
print("Polygon[{",round(A.x,3),",",round(A.y,3),"},",
              "{",round(B.x,3),",",round(B.y,3),"},",
              "{",round(C.x,3),",",round(C.y,3),"},",
              "{",round(D.x,3),",",round(D.y,3),"},",
              "{",round(E.x,3),",",round(E.y,3),"},",
              "{",round(A.x,3),",",round(A.y,3),"}" 
             "]")
```

### wolfram alphaで「入力が最大文字数を超えています．」
Polygon[{ -sqrt(5/8 - sqrt(5)/8) , -sqrt(5)/4 - 1/4 }, { sqrt(5/8 - sqrt(5)/8) , -sqrt(5)/4 - 1/4 }, { sqrt(sqrt(5)/8 + 5/8) , -1/4 + sqrt(5)/4 }, { 0 , 1 }, { -sqrt(sqrt(5)/8 + 5/8) , -1/4 + sqrt(5)/4 }, { -sqrt(5/8 - sqrt(5)/8) , -sqrt(5)/4 - 1/4 }]

### 小数3位に四捨五入しました。
Polygon[{ -0.588 , -0.809 }, { 0.588 , -0.809 }, { 0.951 , 0.309 }, { 0 , 1 }, { -0.951 , 0.309 }, { -0.588 , -0.809 }]

https://www.wolframalpha.com/input?i=Polygon%5B%7B+-0.588+%2C+-0.809+%7D%2C+%7B+0.588+%2C+-0.809+%7D%2C+%7B+0.951+%2C+0.309+%7D%2C+%7B+0+%2C+1+%7D%2C+%7B+-0.951+%2C+0.309+%7D%2C+%7B+-0.588+%2C+-0.809+%7D%5D&lang=ja






# sympyで計算
wikipediaより、辺の長さを a とすると
```python
from sympy import *
a=Symbol('a', real=True, positive=True)
O=Point(0,0)
A=Point(a,0)
t=(pi-(2*pi)/5)/2*2
M=Point(a/2,(a/2)*tan(t/2))
R=Point(O).distance(M).simplify()
print("#内角　　　　",t,t/pi*180,"度")
print("#面積　　　　",(a*M.y/2*5).simplify())
print("#内接円の半径",M.y)
print("#外接円の半径",R)
#内角　　　　 3*pi/5 108 度
#面積　　　　 a**2*sqrt(10*sqrt(5) + 25)/4
#内接円の半径 a*sqrt(2*sqrt(5)/5 + 1)/2
#外接円の半径 a*sqrt(10*sqrt(5) + 50)/10
```

# sympyで作図(matplotlibで)Line(A,B).equationで変換しています。
ABCDはでていません。
?作図する方法を教えて下さい。

![Figure_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/109698/03baf84f-70df-9c91-6a7b-040704a2d983.png)

```python
from sympy import *
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize']=5,5
x=Symbol('x',real=True)
y=Symbol('y',real=True)
t=(2*pi)/5
A=Point(cos(pi/2+t*2),sin(pi/2+t*2))
B=Point(cos(pi/2+t*3),sin(pi/2+t*3))
C=Point(cos(pi/2+t*4),sin(pi/2+t*4))
D=Point(cos(pi/2+t*0),sin(pi/2+t*0))
E=Point(cos(pi/2+t*1),sin(pi/2+t*1))
p=       plot(solve(Line(A,B).equation(),y)[0],(x,A.x,B.x),line_color="red",show=False)
p.extend(plot(solve(Line(B,C).equation(),y)[0],(x,B.x,C.x),line_color="red",show=False))
p.extend(plot(solve(Line(C,D).equation(),y)[0],(x,C.x,D.x),line_color="red",show=False))
p.extend(plot(solve(Line(D,E).equation(),y)[0],(x,D.x,E.x),line_color="red",show=False))
p.extend(plot(solve(Line(E,A).equation(),y)[0],(x,E.x,A.x),line_color="red",show=False))
p.extend(plot(solve(Line(A,D).equation(),y)[0],(x,A.x,D.x),line_color="blue",show=False))
p.extend(plot(solve(Line(B,E).equation(),y)[0],(x,B.x,E.x),line_color="blue",show=False))
p.show()
```



# GRAPESで作図(sympyで計算)20220819

https://qiita.com/mrrclb48z/items/6f8f94ae2d90e1dfc2f3


# CADでも十分な気もしてきました。

# 入試問題

A(1,0),B(2,0)...正五角形ABCDE...

https://qiita.com/mrrclb48z/items/9f690803b5d5ab6f6919

(20220817)正五角形が39件ありました。＜サイト内検索＜大学入試数学問題集成

https://cse.google.com/cse?cx=a8908fbc24340ebc5&q=%E6%AD%A3%E4%BA%94%E8%A7%92%E5%BD%A2&oq=%E6%AD%A3%E4%BA%94%E8%A7%92%E5%BD%A2&gs_l=partner-web.3..0i512j0i433i131j0i512l8.2103170.2111457.0.2112708.21.21.0.0.0.0.184.1969.15j6.21.0.csems%2Cnrl%3D13...0.9748j5491326j40j6...1j4.34.partner-web..1.20.1897.8K8HlxQWO98


(20221110)
正十二面体
第６問（選択問題）（配点 16）< 令和７年度大学入学共通テスト
試作問題『数学Ⅱ，数学Ｂ，数学Ｃ』 

https://www.dnc.ac.jp/albums/abm.php?f=abm00041795.pdf&n=4-2-2+%E8%A9%A6%E4%BD%9C%E5%95%8F%E9%A1%8C%E3%80%8E%E6%95%B0%E5%AD%A6%E2%85%A1%EF%BC%8C%E6%95%B0%E5%AD%A6B%EF%BC%8C%E6%95%B0%E5%AD%A6C%E3%80%8F.pdf#page=18 




https://ja.wikipedia.org/wiki/%E6%AD%A3%E5%8D%81%E4%BA%8C%E9%9D%A2%E4%BD%93

# 54°

(20221111)

https://kamelink.com/blog/2022/11/07/3-4-15-hukusimadai-zinbunsyakai-2/

【２】(2) cos54°の値を求めなさい．

https://mathexamtest.web.fc2.com/2015/201510141/2015101410100mj.html#top-0104


# 正七角形

https://mathexamtest.web.fc2.com/2021/202114891/2021148910500mj.html#top-0505