Replace np.tan with math.tan...because why not

This commit is contained in:
Grant Sanderson 2020-02-21 12:01:39 -08:00
parent 2ca0726cd7
commit 0b0dbcb5d8

View file

@ -1,4 +1,5 @@
import numpy as np import numpy as np
import math
from manimlib.constants import OUT from manimlib.constants import OUT
from manimlib.utils.bezier import interpolate from manimlib.utils.bezier import interpolate
@ -33,7 +34,7 @@ def path_along_arc(arc_angle, axis=OUT):
vects = end_points - start_points vects = end_points - start_points
centers = start_points + 0.5 * vects centers = start_points + 0.5 * vects
if arc_angle != np.pi: if arc_angle != np.pi:
centers += np.cross(unit_axis, vects / 2.0) / np.tan(arc_angle / 2) centers += np.cross(unit_axis, vects / 2.0) / math.tan(arc_angle / 2)
rot_matrix_T = rotation_matrix_transpose(alpha * arc_angle, unit_axis) rot_matrix_T = rotation_matrix_transpose(alpha * arc_angle, unit_axis)
return centers + np.dot(start_points - centers, rot_matrix_T) return centers + np.dot(start_points - centers, rot_matrix_T)