Ellipse2d Methods

The following tables list the members exposed by the Ellipse2d type.

Methods
 
Name Description
Public method AngleToParam(double) Computes an elliptical parameter given an angle in radians.
Public method ArcFit(double)
Public method ArcFit(int)
Public method ClosestPoint(Point2d) Computes a point on the ellipse/elliptical arc that is as close as possible to another point.
Public method CommonTangents(Ellipse2d)
Public method ComputeLength(double) Usually, the Length property of the ellipse should be used. This function can be used in case a custom accuracy is wanted.
Public method Contains(Point2d)
Public method Static CreateFrom5Points(Point2d, Point2d, Point2d, Point2d, Point2d) Creates an ellipse through five points
Public method Static CreateFromEquation(double, double, double, double, double, double) Creates an ellipse from the general conic equation Ax^2+Bxy+Cy^2+Dx+Ey+F=0
Public method Static CreateFromLength(Point2d, double, double, double, double, double) Approximates a new elliptical arc given a startangle and a length. If the length is larger than a full ellipse of the specified parameters, an exception will be thrown (numerical computations will never converge).
Public method Distance(Point2d) Computes a distance from any point to the ellipse/elliptical arc.
Public method DualConic(Ellipse2d)
Public method Eval(double) Evaluates a point on the ellipse given a parameter. The parametric range for an ellipse is 0-2*PI. For an elliptical arc the start an end of the range corresponds to where it resides on the full ellipses circumference.
Public method Flatten(double)
Public method Foci(bool) Computes one of the two focii of the ellipse.
Public method GetEquation()
Public method GetEquation(out double, out double, out double, out double, out double, out double) Gets the conic equation of the ellipse on the form Ax^2+Bxy+Cy^2+Dx+Ey+F=0
Public method IsArc() Returns true if this is an elliptical arc, or false if this is a complete ellipse.
Public method IsEllipsePointOnArc(Point2d) Checks if a point included in the full ellipse is on the elliptical arc by checking it's side of the startpoint-endpoint line. If this ellipse is a full ellipse this function always returns true.
Public method IsParamIncluded(double) Checks if an elliptical parameter is included on the arc. If this is a full ellipse this function always returns true.
Public method Mirror(Point2d, Point2d) Mirrors the ellipse in-place over a line specified by two points.
Public method Normalize() Makes sure the ellipse major axis is longer than the minor axis, and fixes the parameters as needed
Public method Param(Point2d) Calculates the parameter of the point pt in the range 0-2PI.
Public method Param01(double) Converts a parameter in the range 0-2PI to a parameter in the range 0-1 where 0=startparam and 1=endparam on arc
Public method ParamToAngle(double) Computes an angle in radians given an elliptical parameter for this ellipse.
Public method Perpendicular(Point2d) Computes new points on the ellipses periferi, which are perpendicular to the ellipse with respect to a given point. The points are on the full ellipse, even if it is an arc.
Public method Quadrant(int) Returns a new point on the ellipse that is a point on one of the ellipses extremes in the ellipse local coordinate system. The point is always computed as if the ellipse is a full ellipse and not an arc.
Public method Rotate(double) Rotates the ellipse in-place around world origo.
Public method Rotate(double, Point2d) Rotates the ellipse in-place around a given point.
Public method Scale(double) Scales the ellipse in-place using world origo as scaling center.
Public method Scale(double, Point2d) Scales the ellipse in-place using a specified scaling center.
Public method Split(IEnumerable<Double>) Splits the arc in sub-arcs given a list of elliptical parameters. The list of parameters do _not_ need to be sorted.
Public method Split(params double[]) Splits the arc in sub-arcs given a list of elliptical parameters. The list of parameters do _not_ need to be sorted.
Public method Split(double, out Ellipse2d, out Ellipse2d) Splits the arc at a specified elliptical parameter. If the parmeter is out of arcs range, a copy of this object and a zero length arc will be created.
Public method Tangent(Point2d) Computes the tangent angle at a given point on the ellipse.
Public method TangentPoint(Point2d, Side) Computes a point on the ellipses circumference that is the enpoint of a line that tangents the ellipse.
Public method ToConic()
Public method ToRegion(double) Approximates the ellipse in a region representation. Since an ellipse cannot be exactly represented by a region, a tolerance is used to approximate the ellipse into a polygon with linear segments only.
Public method ToString() Creates a new string suitable for debugging purposes.
Public method Transform(Matrix2d) Transforms the ellipse in-place with a matrix. Note that the result is undefined for matrices with non uniform scale.
Public method Translate(double, double) Translates the ellipse in-place using a given delta x and delta y.
Public method WriteAutoCADScript(StreamWriter, int) Writes text data to a stream that is suitable to load into AutoCAD using the script command.
Top

In this article

Definition