wumpus-drawing-0.9.0: High-level drawing objects built on Wumpus-Basic.

Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>
Safe HaskellSafe-Infered



Datatype for cubic Bezier curve.



data BezierCurve u Source

A Strict cubic Bezier curve.


BezierCurve !(Point2 u) !(Point2 u) !(Point2 u) !(Point2 u) 


(Ord u, Tolerance u) => Eq (BezierCurve u) 
(Ord u, Tolerance u) => Ord (BezierCurve u) 
Show u => Show (BezierCurve u) 

vbezierCurve :: Num u => Vec2 u -> Vec2 u -> Vec2 u -> Point2 u -> BezierCurve uSource

subdivide :: Fractional u => BezierCurve u -> (BezierCurve u, BezierCurve u)Source

Curve subdivision via de Casteljau's algorithm.

subdividet :: Real u => u -> BezierCurve u -> (BezierCurve u, BezierCurve u)Source

subdivide with an affine weight along the line...

bezierLength :: (Floating u, Ord u, Tolerance u) => BezierCurve u -> uSource

bezierLength : start_point * control_1 * control_2 * end_point -> Length

Find the length of a Bezier curve. The result is an approximation, with the tolerance is 0.1 of a point. This seems good enough for drawing (potentially the tolerance could be larger still).

The result is found through repeated subdivision so the calculation is potentially costly.