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

Safe HaskellNone

Math.Spline.BSpline.Reference

Description

Reference implementation of B-Splines; very inefficient but "obviously" correct.

Synopsis

Documentation

bases :: (Fractional a, Ord a) => Knots a -> a -> [[a]]Source

The values of all the B-spline basis functions for the given knot vector at the given point, ordered by degree; "b_{i,j}(x)" is bases kts x !! i !! j.

basisFunctions :: (Fractional a, Ord a) => Knots a -> [[a -> a]]Source

All the B-spline basis functions for the given knot vector at the given point, ordered by degree; "b_{i,j}" is basisFunctions kts x !! i !! j.

basisPolynomials :: (Fractional a, Ord a) => Knots a -> [[[Poly a]]]Source

All the B-spline basis polynomials for the given knot vector, ordered first by knot span and then by degree.

basisPolynomialsAt :: (Fractional a, Ord a) => Knots a -> a -> [[Poly a]]Source

All the B-spline basis polynomials for the given knot vector at the given point, ordered by degree; "b_{i,j}" is basisPolynomialsAt kts x !! i !! j.

evalReferenceBSpline :: (VectorSpace a, Fractional (Scalar a), Ord (Scalar a), Vector v a) => BSpline v a -> Scalar a -> aSource

This is a fairly slow function which computes the value of a B-spline at a given point, using the mathematical definition of B-splines. It is mainly for testing purposes, as a reference against which the other evaluation functions are checked.

fitPolyToBSplineAt :: (Fractional a, Ord a, Scalar a ~ a, Vector v a) => BSpline v a -> a -> Poly aSource

This is a fairly slow function which computes one polynomial segment of a B-spline (the one containing the given point), using the mathematical definition of B-splines. It is mainly for testing purposes, as a reference against which the other evaluation functions are checked.