示例#1
0
    def length(self):
        r"""The length of the current curve.

        Computes the length via:

        .. math::

           \int_{B\left(\left[0, 1\right]\right)} 1 \, d\mathbf{x} =
           \int_0^1 \left\lVert B'(s) \right\rVert_2 \, ds

        Returns:
            float: The length of the current curve.
        """
        return _curve_helpers.compute_length(self._nodes)
示例#2
0
 def length(self):
     """float: The length of the current curve."""
     if self._length is None:
         self._length = _curve_helpers.compute_length(
             self._nodes, self._degree)
     return self._length
示例#3
0
    def _call_function_under_test(nodes, degree):
        from bezier import _curve_helpers

        return _curve_helpers.compute_length(nodes, degree)