Safe Haskell | None |
---|---|
Language | Haskell98 |
- data CubicBezier = CubicBezier {}
- data PathJoin
- data Path
- class AffineTransform a where
- bezierParam :: Double -> Bool
- bezierParamTolerance :: CubicBezier -> Double -> Double
- reorient :: CubicBezier -> CubicBezier
- bezierToBernstein :: CubicBezier -> (BernsteinPoly, BernsteinPoly)
- evalBezier :: CubicBezier -> Double -> Point
- evalBezierDeriv :: CubicBezier -> Double -> (Point, Point)
- evalBezierDerivs :: CubicBezier -> Double -> [Point]
- findBezierTangent :: Point -> CubicBezier -> [Double]
- bezierHoriz :: CubicBezier -> [Double]
- bezierVert :: CubicBezier -> [Double]
- findBezierInflection :: CubicBezier -> [Double]
- findBezierCusp :: CubicBezier -> [Double]
- arcLength :: CubicBezier -> Double -> Double -> Double
- arcLengthParam :: CubicBezier -> Double -> Double -> Double
- splitBezier :: CubicBezier -> Double -> (CubicBezier, CubicBezier)
- bezierSubsegment :: CubicBezier -> Double -> Double -> CubicBezier
- splitBezierN :: CubicBezier -> [Double] -> [CubicBezier]
- colinear :: CubicBezier -> Double -> Bool
Documentation
data CubicBezier Source
class AffineTransform a where Source
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.