Cody

# Problem 43648. Arc length of points interpolation

Solution 1728602

Submitted on 16 Feb 2019 by William
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
points = [[1; 0] [0; 1] [-1; 0] [0; -1]]; dist_correct = 5.945066529883204; assert(abs(arcLength(points) - dist_correct) < 1e-6)

2   Pass
points = eye(2); dist_correct = 2 * sqrt(2); assert(abs(arcLength(points) - dist_correct) < 1e-6)

3   Pass
points = [cos(2*pi/500*(1:500)); sin(2*pi/500*(1:500))]; dist_correct = 6.283185305221142; assert(abs(arcLength(points) - dist_correct) < 1e-6)

4   Pass
points = [[0 0 0]' [1 0 0]' [1 0 1]' [0 0 1]' [0 1 1]' [1 1 1]' [1 1 0]' [0 1 0]']; dist_correct = 8.367321074314315; assert(abs(arcLength(points) - dist_correct) < 1e-6)

5   Pass
points = [6 -8 -7 -7 3 5;8 -4 9 -1 -9 5;-7 1 9 8 7 -2;8 9 0 6 8 3;3 9 6 9 3 -6]; dist_correct = 101.32625280165301; assert(abs(arcLength(points) - dist_correct) < 1e-6)

6   Pass
w = 0.887321243287836; points = [-w 0 w 1 1 1 w 0 -w -1 -1 -1; -1 -1 -1 -w 0 w 1 1 1 w 0 -w]; dist_correct = 8; assert(abs(arcLength(points) - dist_correct) < 1e-6)