@pytest.mark.parametrize('start,end,nvec,cw,ds,expected_points', [([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0]], [0, 0, 1], True, (pi / 2), 3), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0]], [0, 0, 1], True, pi, 2), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0]], [0, 0, 1], True, ((pi / 2) * 1.1), 2), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0]], [0, 0, 1], False, (pi / 5), 6), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, (- 1), 0]], [0, 0, 1], True, ((6 / 16) * pi), 5), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [0, 0, 1], False, ((2 / 3) * pi), 4), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, (- 1), 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 0, (- 1)]], [1, 0, 0], True, ((6 / 16) * pi), 5), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, ((- 0.5) * sqrt(2)), (0.5 * sqrt(2))]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, (0.5 * sqrt(2)), ((- 0.5) * sqrt(2))]], [0, 1, 1], False, (pi / 5), 6)])
def test_circular_interpolation(start, end, nvec, cw, ds, expected_points):
    start = get_tform(*start)
    end = get_tform(*end)
    interpolated_tforms = list(circular_interpolation(start, end, [0, 0, 0], nvec, cw, ds=ds))
    print(interpolated_tforms)
    helper_spatial_interpolation_test(interpolated_tforms, start, end, expected_points)
    r = np.linalg.norm(start[0:3, 3])
    for tform in interpolated_tforms:
        assert (pytest.approx(r, rel=0.01) == np.linalg.norm(tform[0:3, 3]))
    if (expected_points > 3):
        ds_straight_line_ref = np.linalg.norm((interpolated_tforms[1][0:3, 3] - interpolated_tforms[0][0:3, 3]))
        for i in range(1, (expected_points - 1)):
            ds_actual = np.linalg.norm((interpolated_tforms[(i + 1)][0:3, 3] - interpolated_tforms[i][0:3, 3]))
            assert (pytest.approx(ds_straight_line_ref, rel=0.1) == ds_actual)
@pytest.mark.parametrize('start,end,nvec,cw,ds,expected_points', [([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0]], [0, 0, 1], True, (pi / 2), 3), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0]], [0, 0, 1], True, pi, 2), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0]], [0, 0, 1], True, ((pi / 2) * 1.1), 2), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0]], [0, 0, 1], False, (pi / 5), 6), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, (- 1), 0]], [0, 0, 1], True, ((6 / 16) * pi), 5), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [(- 1), 0, 0]], [0, 0, 1], False, ((2 / 3) * pi), 4), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, (- 1), 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 0, (- 1)]], [1, 0, 0], True, ((6 / 16) * pi), 5), ([[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, ((- 0.5) * sqrt(2)), (0.5 * sqrt(2))]], [[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, (0.5 * sqrt(2)), ((- 0.5) * sqrt(2))]], [0, 1, 1], False, (pi / 5), 6)])
def test_circular_interpolation(start, end, nvec, cw, ds, expected_points):
    start = get_tform(*start)
    end = get_tform(*end)
    interpolated_tforms = list(circular_interpolation(start, end, [0, 0, 0], nvec, cw, ds=ds))
    print(interpolated_tforms)
    helper_spatial_interpolation_test(interpolated_tforms, start, end, expected_points)
    r = np.linalg.norm(start[0:3, 3])
    for tform in interpolated_tforms:
        assert (pytest.approx(r, rel=0.01) == np.linalg.norm(tform[0:3, 3]))
    if (expected_points > 3):
        ds_straight_line_ref = np.linalg.norm((interpolated_tforms[1][0:3, 3] - interpolated_tforms[0][0:3, 3]))
        for i in range(1, (expected_points - 1)):
            ds_actual = np.linalg.norm((interpolated_tforms[(i + 1)][0:3, 3] - interpolated_tforms[i][0:3, 3]))
            assert (pytest.approx(ds_straight_line_ref, rel=0.1) == ds_actual)