Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc1d9eb

Browse files
committed
Removed 'import math'
Replaced math.pi with numpy.pi.
1 parent f1b5017 commit cc1d9eb

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

examples/mplot3d/trisurf3d_demo.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
from matplotlib import cm
33
import matplotlib.pyplot as plt
44
import numpy as np
5-
import math
65

76
n_angles = 36
87
n_radii = 8
98
min_radius = 0.25
109
radii = np.linspace(min_radius, 0.95, n_radii)
1110

12-
angles = np.linspace(0, 2*math.pi, n_angles, endpoint=False)
11+
angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)
1312
angles = np.repeat(angles[...,np.newaxis], n_radii, axis=1)
14-
angles[:,1::2] += math.pi/n_angles
13+
angles[:,1::2] += np.pi/n_angles
1514

1615
x = np.append(0, (radii*np.cos(angles)).flatten())
1716
y = np.append(0, (radii*np.sin(angles)).flatten())

0 commit comments

Comments
 (0)