Safe Haskell | None |
---|---|

Language | Haskell98 |

Intersection routines using Bezier Clipping. Provides also functions for finding the roots of onedimensional bezier curves. This can be used as a general polynomial root solver by converting from the power basis to the bernstein basis.

- bezierIntersection :: CubicBezier Double -> CubicBezier Double -> Double -> [(Double, Double)]
- bezierLineIntersections :: CubicBezier Double -> Line Double -> Double -> [Double]
- bezierFindRoot :: BernsteinPoly Double -> Double -> Double -> Double -> [Double]

# Documentation

bezierIntersection :: CubicBezier Double -> CubicBezier Double -> Double -> [(Double, Double)] Source #

Find the intersections between two Bezier curves, using the Bezier Clip algorithm. Returns the parameters for both curves.

bezierLineIntersections :: CubicBezier Double -> Line Double -> Double -> [Double] Source #

Find the intersections of the curve with a line.

:: BernsteinPoly Double | the bernstein coefficients of the polynomial |

-> Double | The lower bound of the interval |

-> Double | The upper bound of the interval |

-> Double | The accuracy |

-> [Double] | The roots found |

Find the zero of a 1D bezier curve of any degree. Note that this can be used as a bernstein polynomial root solver by converting from the power basis to the bernstein basis.