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

Safe HaskellNone




data PathJoin Source


JoinCurve Point Point 


data Path Source


bezierParam :: Double -> BoolSource

Return True if the param lies on the curve, iff it's in the interval [0, 1].

bezierParamTolerance :: CubicBezier -> Double -> DoubleSource

Convert a tolerance from the codomain to the domain of the bezier curve. Should be good enough, but may not hold for high very tolerance values.

reorient :: CubicBezier -> CubicBezierSource

Reorient to the curve B(1-t).

bezierToBernstein :: CubicBezier -> (BernsteinPoly, BernsteinPoly)Source

Give the bernstein polynomial for each coordinate.

evalBezier :: CubicBezier -> Double -> PointSource

Calculate a value on the curve.

evalBezierDeriv :: CubicBezier -> Double -> (Point, Point)Source

Calculate a value and the first derivative on the curve.

evalBezierDerivs :: CubicBezier -> Double -> [Point]Source

Calculate a value and all derivatives on the curve.

findBezierTangent :: Point -> CubicBezier -> [Double]Source

findBezierTangent p b finds the parameters where the tangent of the bezier curve b has the same direction as vector p.

bezierHoriz :: CubicBezier -> [Double]Source

Find the parameter where the bezier curve is horizontal.

bezierVert :: CubicBezier -> [Double]Source

Find the parameter where the bezier curve is vertical.

findBezierInflection :: CubicBezier -> [Double]Source

Find inflection points on the curve.

findBezierCusp :: CubicBezier -> [Double]Source

Find the cusps of a bezier.

arcLengthParam :: CubicBezier -> Double -> Double -> DoubleSource

arcLengthParam c len tol finds the parameter where the curve c has the arclength len, within tolerance tol.

splitBezier :: CubicBezier -> Double -> (CubicBezier, CubicBezier)Source

Split a bezier curve into two curves.

bezierSubsegment :: CubicBezier -> Double -> Double -> CubicBezierSource

Return the subsegment between the two parameters.

splitBezierN :: CubicBezier -> [Double] -> [CubicBezier]Source

Split a bezier curve into a list of beziers The parameters should be in ascending order or the result is unpredictable.

colinear :: CubicBezier -> Double -> BoolSource

Return True if all the control points are colinear within tolerance.