cubicbezier-0.3.0: Efficient manipulating of 2D cubic bezier curves.

Safe HaskellSafe-Inferred
LanguageHaskell98

Math.BernsteinPoly

Synopsis

Documentation

bernsteinSubsegment :: BernsteinPoly -> Double -> Double -> BernsteinPoly Source

Return the subsegment between the two parameters.

listToBernstein :: [Double] -> BernsteinPoly Source

Create a bernstein polynomail from a list of coëfficients.

zeroPoly :: BernsteinPoly Source

The constant zero.

(~*) :: BernsteinPoly -> BernsteinPoly -> BernsteinPoly infixl 7 Source

Multiply two bernstein polynomials. The final degree will be the sum of either degrees. This operation takes O((n+m)^2) with n and m the degree of the beziers.

(*~) :: Double -> BernsteinPoly -> BernsteinPoly infixl 7 Source

Scale a bernstein polynomial by a constant.

(~+) :: BernsteinPoly -> BernsteinPoly -> BernsteinPoly infixl 6 Source

Sum two bernstein polynomials. The final degree will be the maximum of either degrees.

(~-) :: BernsteinPoly -> BernsteinPoly -> BernsteinPoly infixl 6 Source

Subtract two bernstein polynomials. The final degree will be the maximum of either degrees.

degreeElevate :: BernsteinPoly -> Int -> BernsteinPoly Source

Degree elevate a bernstein polynomail a number of times.

bernsteinSplit :: BernsteinPoly -> Double -> (BernsteinPoly, BernsteinPoly) Source

Split a bernstein polynomial

bernsteinEval :: BernsteinPoly -> Double -> Double Source

Evaluate the bernstein polynomial.

bernsteinEvalDerivs :: BernsteinPoly -> Double -> [Double] Source

Evaluate the bernstein polynomial and its derivatives.

bernsteinDeriv :: BernsteinPoly -> BernsteinPoly Source

Find the derivative of a bernstein polynomial.