Edited at

# geometry > numpy > pentagon (五角形）の座標を得る | Matplotlibでの描画 > v0.1, v0.2

```GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 16.04.4 LTS desktop amd64
TensorFlow v1.7.0
cuDNN v5.1 for Linux
CUDA v8.0
Python 3.5.2
IPython 6.0.0 -- An enhanced Interactive Python.
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
scipy v0.19.1
geopandas v0.3.0
MATLAB R2017b (Home Edition)
gnustep-gui-runtime v0.24.0-3.1
PyMieScatt v1.7.0
```

### 処理概要

• Pentagonの形状を得る
• Matplotlibで描画する

### code v0.1

geometry_starShaped_180414.ipynb
```%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt

'''
v0.1 Apr. 14, 2018
+ to obtain pentagon geometry
'''

NUM_VERT = 5  # number of vertices (5: for pentagon)

xs, ys = [], []
for idx in range(NUM_VERT):
theta = 2.0 * np.pi * idx / NUM_VERT
theta += np.pi / 2.0  # to put the one vertex upward
xs += [np.cos(theta)]
ys += [np.sin(theta)]
return xs, ys

fig = plt.figure()

ax.scatter(xs, ys)

ax.set_xlabel('x')
ax.set_ylabel('y')
ax.grid(True)

```

### code v0.2

• Pentagonを上向き、下向きにする引数を追加
• fix bug: get_pentagon() did not use [radius] arg
geometry_starShaped_180414.ipynb
```%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt

'''
v0.2 Apr. 14, 2018
- fix bug: get_pentagon() did not use [radius] arg
- get_pentagon() takes [upward] arg
v0.1 Apr. 14, 2018
+ to obtain pentagon geometry
'''

NUM_VERT = 5  # number of vertices (5: for pentagon)

xs, ys = [], []
for idx in range(NUM_VERT):
theta = 2.0 * np.pi * idx / NUM_VERT
if upward:
theta += np.pi / 2.0  # to put the one vertex upward
else:
theta -= np.pi / 2.0  # to put the one vertex downward
return xs, ys

fig = plt.figure()