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.
Ellipse2d.centerPoint exampleEllipse
--> Point2d.meters 10 10Get the X axis of an ellipse.
Ellipse2d.xAxis exampleEllipse
--> Axis2d.through (Point2d.meters 10 10)
--> (Direction2d.degrees 30)Get the Y axis of an ellipse.
Ellipse2d.yAxis exampleEllipse
--> Axis2d.through (Point2d.meters 10 10)
--> (Direction2d.degrees 120)Get the direction of the ellipse's X axis.
Ellipse2d.xDirection exampleEllipse
--> Direction2d.degrees 30Get the direction of an ellipse's Y axis.
Ellipse2d.yDirection exampleEllipse
--> Direction2d.degrees 120Get 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 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.
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.
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).
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.