Maintainer | diagrams-discuss@googlegroups.com |
---|
Two-dimensional ellipses (and, as a special case, circles).
- circle :: (Backend b R2, Renderable Ellipse b) => Diagram b R2
- ellipse :: (Backend b R2, Renderable Ellipse b) => Double -> Diagram b R2
- data Ellipse = Ellipse (Transformation R2)
- ellipseCenter :: Ellipse -> P2
- ellipseAngle :: Ellipse -> Angle
- ellipseAxes :: Ellipse -> (R2, R2)
- ellipseScale :: Ellipse -> (Double, Double)
- ellipseCoeffs :: Ellipse -> (Double, Double, Double, Double, Double, Double)
Ellipse and circle diagrams
ellipse :: (Backend b R2, Renderable Ellipse b) => Double -> Diagram b R2Source
ellipse e
constructs an ellipse with eccentricity e
by
scaling the unit circle in the X direction. The eccentricity must
be within the interval [0,1).
Mathematical ellipses
Representation
An ellipse is represented by an affine transformation acting on the unit circle.
Extracting attributes
ellipseCenter :: Ellipse -> P2Source
Compute the center of an ellipse.
ellipseAngle :: Ellipse -> AngleSource
Compute the angle to the major axis of an ellipse, measured counterclockwise from the positive x axis. The result will be in the range [0, pi).
ellipseAxes :: Ellipse -> (R2, R2)Source
Compute the vectors (va, vb) from the center of the ellipse to the edge of the ellipse along the major and minor axes. These vectors can lie in any quadrant, depending on how the ellipse has been transformed.
ellipseScale :: Ellipse -> (Double, Double)Source
Compute the scaling factors of an ellipse, i.e. (a,b) where a and b are half the lengths of the major and minor axes respectively.