Ellipse

References
[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 144)] [Serializable] public struct Ellipse : IEpsilonComparable<Ellipse>, ICloneable
Represents the values of a plane and the two semi-axes radii in an ellipse.

Constructors

Ellipse

#Since v5.0
public Ellipse(Plane plane, double radius1, double radius2)
Initializes a new ellipse from base plane and both principal radii.
plane (Plane)Base plane of ellipse.
radius1 (double)Ellipse radius along base plane X direction.
radius2 (double)Ellipse radius along base plane Y direction.

Ellipse

#Since v5.0
public Ellipse(Point3d center, Point3d second, Point3d third)
Initializes a new ellipse from a center point and the two semi-axes intersections.
center (Point3d)A center for the ellipse. The average of the foci.
second (Point3d)The intersection of the ellipse X axis with the ellipse itself.
third (Point3d)A point that determines the radius along the Y semi-axis.

If the point is at right angle with the (center - second point) vector, it will be the intersection of the ellipse Y axis with the ellipse itself.

Properties

Center

#Since v7.16
public Point3d Center { get; set; }
Gets or sets the center of the ellipse.

FocalDistance

#Since v7.16
public double FocalDistance { get; }
Gets the distance from the center to a focus.

IsValid

#Since v6.0
public bool IsValid { get; }
Returns an indication of the validity of this ellipse.

Plane

#Since v5.0
public Plane Plane { get; set; }
Gets or sets the base plane of the ellipse.

Radius1

#Since v5.0
public double Radius1 { get; set; }
Gets or sets the radius of the ellipse along the base plane X semi-axis.

Radius2

#Since v5.0
public double Radius2 { get; set; }
Gets or sets the radius of the ellipse along the base plane Y semi-axis.

Methods

EpsilonEquals

#Since v5.4
[ConstOperation] public bool EpsilonEquals(Ellipse other, double epsilon)
Check that all values in other are within epsilon of the values in this
other (Ellipse)
epsilon (double)
EpsilonEquals

GetFoci

#Since v7.16
public void GetFoci(out Point3d F1, out Point3d F2)
Gets the foci. The foci are two points whose sum of distances from any point on the ellipse is always the same.
F1 (out Point3d)The first focus.
F2 (out Point3d)The second focus.
Explicit

ICloneable.Clone

#

ToNurbsCurve

#Since v5.0
[ConstOperation] public NurbsCurve ToNurbsCurve()
Constructs a nurbs curve representation of this ellipse.

This is equivalent to calling NurbsCurve.CreateFromEllipse().

A nurbs curve representation of this ellipse or null if no such representation could be made.

TryFitEllipseToPoints

#Since v9.0
public static bool TryFitEllipseToPoints(IEnumerable<Point3d> points, out Ellipse ellipse)
Attempt to fit an ellipse through a set of points.
points (IEnumerable<Point3d>)The points through which to fit.
ellipse (out Ellipse)The resulting ellipse on success.
true on success, false on failure.