Package georegression.geometry
Class UtilEllipse_F64
java.lang.Object
georegression.geometry.UtilEllipse_F64
Functions for extracting information from ellipses and converting between different ellipse formats.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
computeAngle
(Point2D_F64 p, EllipseRotated_F64 ellipse) Computes the value of 't' used to specify a point's locationstatic Point2D_F64
computePoint
(double t, EllipseRotated_F64 ellipse, @Nullable Point2D_F64 output) Computes the point on the ellipse at location 't', where t is an angle in radiansstatic Vector2D_F64
computeTangent
(double t, EllipseRotated_F64 ellipse, @Nullable Vector2D_F64 output) Computes the tangent to the ellipse at the specified locationstatic EllipseRotated_F64
convert
(EllipseQuadratic_F64 input, @Nullable EllipseRotated_F64 output) Convert from quadratic to rotated formats.static EllipseQuadratic_F64
convert
(EllipseRotated_F64 input, @Nullable EllipseQuadratic_F64 output) Convert from rotated to quadratic.static double
evaluate
(double x, double y, EllipseQuadratic_F64 ellipse) Computes the value of the quadratic ellipse function at point (x,y).static double
evaluate
(double x, double y, EllipseRotated_F64 ellipse) Computes the value of the quadratic ellipse function at point (x,y).static boolean
tangentLines
(EllipseRotated_F64 ellipseA, EllipseRotated_F64 ellipseB, Point2D_F64 tangentA0, Point2D_F64 tangentA1, Point2D_F64 tangentA2, Point2D_F64 tangentA3, Point2D_F64 tangentB0, Point2D_F64 tangentB1, Point2D_F64 tangentB2, Point2D_F64 tangentB3) Finds four lines which are tangent to both ellipses.static boolean
tangentLines
(Point2D_F64 pt, EllipseRotated_F64 ellipse, Point2D_F64 tangentA, Point2D_F64 tangentB) Finds two points on the ellipse that in combination with point 'pt' each define a line that is tangent to the ellipse.
-
Constructor Details
-
UtilEllipse_F64
public UtilEllipse_F64()
-
-
Method Details
-
convert
public static EllipseRotated_F64 convert(EllipseQuadratic_F64 input, @Nullable @Nullable EllipseRotated_F64 output) Convert from quadratic to rotated formats. Equations taken from [1].
[1] David Eberly "Information About Ellipses", Geometric Tools, LLC 2011
- Parameters:
input
- Input in quadratic format.output
- (Optional) Storage for converted format. Can be null.- Returns:
- Ellipse in rotated format.
-
convert
public static EllipseQuadratic_F64 convert(EllipseRotated_F64 input, @Nullable @Nullable EllipseQuadratic_F64 output) Convert from rotated to quadratic.- Parameters:
input
- Input rotated format.output
- (Optional) Storage for quadratic format. Can be null.- Returns:
- Ellipse in quadratic format.
-
evaluate
Computes the value of the quadratic ellipse function at point (x,y). Should equal 0 if the point is along the ellipse.- Parameters:
x
- x-coordinatey
- y-coordinateellipse
- Ellipse equation being evaluated.- Returns:
- value of ellipse equation at point (x,y)
-
evaluate
Computes the value of the quadratic ellipse function at point (x,y). Should equal 1 if the point is on the ellipse.- Parameters:
x
- x-coordinatey
- y-coordinateellipse
- Ellipse equation being evaluated.- Returns:
- value of ellipse equation at point (x,y)
-
computePoint
public static Point2D_F64 computePoint(double t, EllipseRotated_F64 ellipse, @Nullable @Nullable Point2D_F64 output) Computes the point on the ellipse at location 't', where t is an angle in radians- Parameters:
t
- An angle in radians from 0 to 2*PIellipse
- Ellipseoutput
- (Optional) point on the ellipse . Can be null.- Returns:
- Point on the ellipse
-
computeAngle
Computes the value of 't' used to specify a point's location- Parameters:
p
- Point on the ellipseellipse
- Ellipse- Returns:
- Angle from -pi to pi
-
computeTangent
public static Vector2D_F64 computeTangent(double t, EllipseRotated_F64 ellipse, @Nullable @Nullable Vector2D_F64 output) Computes the tangent to the ellipse at the specified location- Parameters:
t
- Location on the ellipse. Radiansellipse
- Ellipse equationoutput
- Optional storage for tangent- Returns:
- The tangent
-
tangentLines
public static boolean tangentLines(Point2D_F64 pt, EllipseRotated_F64 ellipse, Point2D_F64 tangentA, Point2D_F64 tangentB) Finds two points on the ellipse that in combination with point 'pt' each define a line that is tangent to the ellipse.
Notes:
Point 'pt' is assumed to be outside of the ellipse.- Parameters:
pt
- Point which the lines will pass thoughellipse
- The ellipse which the lines will be tangent totangentA
- (output) Point on the ellipse where tangent line A hits ittangentB
- (output) Point on the ellipse where tangent line B hits it
-
tangentLines
public static boolean tangentLines(EllipseRotated_F64 ellipseA, EllipseRotated_F64 ellipseB, Point2D_F64 tangentA0, Point2D_F64 tangentA1, Point2D_F64 tangentA2, Point2D_F64 tangentA3, Point2D_F64 tangentB0, Point2D_F64 tangentB1, Point2D_F64 tangentB2, Point2D_F64 tangentB3) Finds four lines which are tangent to both ellipses. Both ellipses must not intersect. Line 0 and line 3 will not intersect the line joining the center of the two ellipses while line 1 and 2 will.
- Parameters:
ellipseA
- (Input) First ellipseellipseB
- (Input) Second ellipsetangentA0
- (Output) Point on ellipseA in which tangent line0 passes throughtangentA1
- (Output) Point on ellipseA in which tangent line1 passes throughtangentA2
- (Output) Point on ellipseA in which tangent line2 passes throughtangentA3
- (Output) Point on ellipseA in which tangent line3 passes throughtangentB0
- (Output) Point on ellipseB in which tangent line0 passes throughtangentB1
- (Output) Point on ellipseB in which tangent line1 passes throughtangentB2
- (Output) Point on ellipseB in which tangent line2 passes throughtangentB3
- (Output) Point on ellipseB in which tangent line3 passes through- Returns:
- true if a solution was found or false if it failed
- See Also:
-