def normal(self, t, above=True):
""" Evaluate the normal of the curve at the given parametric value(s).
This function returns an *n* × 3 array, where *n* is the number of
evaluation points.
The normal is computed as the cross product between the binormal and
the tangent of the curve.
:param t: Parametric coordinates in which to evaluate
:type t: float or [float]
:param bool above: Evaluation in the limit from above
:return: Derivative array
:rtype: numpy.array
"""
# error test input
if self.dimension != 3:
raise RuntimeError('Normals require dimension = 3')
# compute derivative
T = self.tangent(t, above=above)
B = self.binormal(t, above=above)
return np.cross(B,T)
评论列表
文章目录