test__curve_helpers.py 文件源码

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

项目:bezier 作者: dhermes 项目源码 文件源码
def test_quadratic(self):
        self._scipy_skip()
        nodes = np.asfortranarray([
            [0.0, 0.0],
            [1.0, 2.0],
            [2.0, 0.0],
        ])
        length = self._call_function_under_test(nodes)
        # 2 INT_0^1 SQRT(16 s^2  - 16 s + 5) ds = SQRT(5) + sinh^{-1}(2)/2
        arcs2 = np.arcsinh(2.0)  # pylint: disable=no-member
        expected = np.sqrt(5.0) + 0.5 * arcs2
        local_eps = abs(SPACING(expected))
        self.assertAlmostEqual(length, expected, delta=local_eps)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号