An ellipse is defined by a center point, X and Y radius, and X and Y axes (which will always be perpendicular to each other). Ellipses are symmetric about their X and Y axes. This module includes functionality for
Construct an ellipse from its center point, X direction, and X and Y radii. If you pass a negative radius, the absolute value will be used.
exampleEllipse =
Ellipse2d.with
{ centerPoint = Point2d.meters 10 10
, xDirection = Direction2d.degrees 30
, xRadius = Length.meters 5
, yRadius = Length.meters 3
}Get the center point of an ellipse.
Get the X and Y axes of an ellipse as a Frame2d.
Ellipse2d.axes exampleEllipse
--> Frame2d.withXDirection (Direction2d.degrees 30)
--> (Point2d.meters 10 10)Get the X axis of an ellipse.
Get the Y axis of an ellipse.
Get the direction of the ellipse's X axis.
Get the direction of an ellipse's Y axis.
Get the radius of an ellipse along its X axis. This may be either the minimum or maximum radius.
Ellipse2d.xRadius exampleEllipse
--> Length.meters 5Get the radius of an ellipse along its Y axis. This may be either the minimum or maximum radius.
Ellipse2d.yRadius exampleEllipse
--> Length.meters 3Get the area of an ellipse.
Ellipse2d.area exampleEllipse
--> Area.squareMeters 47.1239Convert an ellipse to a 360 degree elliptical arc.
Get the minimal bounding box containing a given ellipse.
Project an ellipse onto an axis, returning the range of projected distances along that axis.
These transformations generally behave just like the ones in the Point2d
module.
Scale an ellipse about a given point by a given scale.
Rotate an ellipse around a given point by a given angle.
Translate an ellipse by a given displacement.
Translate an ellipse in a given direction by a given distance.
Mirror an ellipse across a given axis. Note that if the axes of the original ellipse form a right-handed frame, then the axes of the mirrored ellipse will form a left-handed frame (and vice versa).
Convert an ellipse from one units type to another, by providing a conversion factor given as a rate of change of destination units with respect to source units.
Convert an ellipse from one units type to another, by providing an 'inverse' conversion factor given as a rate of change of source units with respect to destination units.
Take an ellipse defined in global coordinates, and return it expressed in local coordinates relative to a given reference frame.
Take an ellipse considered to be defined in local coordinates relative to a given reference frame, and return that circle expressed in global coordinates.