Curve.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Splipy 作者: sintefmath 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号