splines-0.1: B-Splines, other splines, and NURBS.

Math.Spline.Knots

Synopsis

# Documentation

data Knots a Source

Knot vectors - multisets of points in a 1-dimensional space.

Instances

 Foldable Knots Eq a => Eq (Knots a) Ord a => Ord (Knots a) Show a => Show (Knots a) Ord a => Monoid (Knots a)

knot :: Ord a => a -> Knots aSource

Create a knot vector consisting of one knot.

multipleKnot :: Ord a => a -> Int -> Knots aSource

Create a knot vector consisting of one knot with the specified multiplicity.

mkKnots :: Ord a => [a] -> Knots aSource

Create a knot vector consisting of all the knots in a list.

fromList :: Ord k => [(k, Int)] -> Knots kSource

Create a knot vector consisting of all the knots and corresponding multiplicities in a list.

knots :: Knots t -> [t]Source

Returns a list of all knots (not necessarily distinct) of a knot vector in ascending order

numKnots :: Knots t -> IntSource

Returns the number of knots (not necessarily distinct) in a knot vector.

toList :: Knots k -> [(k, Int)]Source

Returns a list of all distinct knots in ascending order along with their multiplicities.

distinctKnots :: Knots t -> [t]Source

Returns a list of all distinct knots of a knot vector in ascending order

Returns the number of distinct knots in a knot vector.

knotMultiplicity :: Ord k => k -> Knots k -> IntSource

Looks up the multiplicity of a knot (which is 0 if the point is not a knot)

setKnotMultiplicity :: Ord k => k -> Int -> Knots k -> Knots kSource

Returns a new knot vector with the given knot set to the specified multiplicity and all other knots unchanged.

knotDomain :: Knots a -> Int -> Maybe (a, a)Source

`knotDomain kts p` return the domain of a B-spline or NURBS with knot vector `kts` and degree `p`. This is the subrange spanned by all except the first and last `p` knots. Outside this domain, the spline does not have a complete basis set. De Boor's algorithm assumes that the basis functions sum to 1, which is only true on this range, and so this is also precisely the domain on which de Boor's algorithm is valid.