示例#1
0
def test_reverse_parametric():
    t = np.linspace(0, np.pi, 10)
    x = np.cos(t)
    y = np.sin(t)

    curve = Curve([x, y], tdata=t)
    reversed_curve = curve.reverse()

    assert reversed_curve == Curve([x[::-1], y[::-1]])
    assert reversed_curve.t == pytest.approx(np.linspace(np.pi, 0, 10))
示例#2
0
def test_coorientplane_3d(axis1, axis2):
    curve = Curve([(1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12)])
    curve_r = curve.reverse()

    assert curve.coorientplane(axis1, axis2) == curve_r.coorientplane(axis1, axis2)
示例#3
0
def test_coorientplane_2d():
    curve = Curve([(1, 2, 3, 4), (5, 6, 7, 8)])
    curve_r = curve.reverse()

    assert curve.coorientplane() == curve_r.coorientplane()
示例#4
0
def test_reverse():
    curve = Curve([(1, 2, 3, 4), (5, 6, 7, 8)])
    assert curve.reverse() == Curve([(4, 3, 2, 1), (8, 7, 6, 5)])