Points along a path

Points along a path

A sequence of 2D, 3D .. nD points is required. There is no limit on the number of coordinate dimensions. The first coordinate of each point become the abcissae (e.g. the x coordinate values). The second [, third etc.] become [successive] ordinates (e.g. the ys, zs ...).

Every point in a givne sequence must has the same number of constiuent coordinates. Coordinates are considered to be values along orthonormal axes. All ordinate axes are fitted with respect to the same abcissae. So, the arcs that connect successive ys are arcs hewn from a succession of (x_i, y_i) ordered pairs and the arcs connecting successive zs are arcs hewn from a succession of (x_i, z_i) ordered pairs. It is easy to work with other axial pairings. To generate arcs using the sequence of (y_i, z_i) pairs: ys_zs = catmullrom( collect(zip(ys, zs)) ).

The point sequence itself may be provided as a vector of points or as a tuple of points.

Type used for a Pointexamplecoordinates are retrievableyou support
small vector[1.0, 3.5 ]coord(point, i) = point[i]builtin
small tuple(1.0, 3.5)coord(point, i) = point[i]builtin
StaticVectorSVector( 1.0, 3.5 )coord(point, i) = point[i]builtin
NamedTuple(x = 1.0, y = 3.5 )coord(point, i) = point[i]builtin
structPoint(1.0, 3.5)coord(point, i) = point[i]getindex
struct Point{T}

function Base.getindex(point::Point{T}, i::Integer) where T
    if i == 1
    elseif i == 2
    elseif i == 3
       throw(DomainError("i must be 1, 2, or 3 (not $i)"))