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

Safe HaskellNone
LanguageHaskell98

Geom2D.CubicBezier.Basic

Synopsis

Documentation

data PathJoin Source

Constructors

JoinLine 
JoinCurve Point Point 

Instances

data Path Source

Instances

bezierParam :: Double -> Bool Source

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

bezierParamTolerance :: CubicBezier -> Double -> Double Source

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 -> CubicBezier Source

Reorient to the curve B(1-t).

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

Give the bernstein polynomial for each coordinate.

evalBezier :: CubicBezier -> Double -> Point Source

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.

arcLength :: CubicBezier -> Double -> Double -> Double Source

@arcLength c t tol finds the arclength of the bezier c at t, within given tolerance tol.

arcLengthParam :: CubicBezier -> Double -> Double -> Double Source

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 -> CubicBezier Source

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 -> Bool Source

Return False if some points fall outside a line with a thickness of the given tolerance.