Class UtilEllipse_F64

java.lang.Object
georegression.geometry.UtilEllipse_F64

public class UtilEllipse_F64 extends Object
Functions for extracting information from ellipses and converting between different ellipse formats.
  • 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

      public static double evaluate(double x, double y, EllipseQuadratic_F64 ellipse)
      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-coordinate
      y - y-coordinate
      ellipse - Ellipse equation being evaluated.
      Returns:
      value of ellipse equation at point (x,y)
    • evaluate

      public static double evaluate(double x, double y, EllipseRotated_F64 ellipse)
      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-coordinate
      y - y-coordinate
      ellipse - 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*PI
      ellipse - Ellipse
      output - (Optional) point on the ellipse . Can be null.
      Returns:
      Point on the ellipse
    • computeAngle

      public static double computeAngle(Point2D_F64 p, EllipseRotated_F64 ellipse)
      Computes the value of 't' used to specify a point's location
      Parameters:
      p - Point on the ellipse
      ellipse - 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. Radians
      ellipse - Ellipse equation
      output - 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 though
      ellipse - The ellipse which the lines will be tangent to
      tangentA - (output) Point on the ellipse where tangent line A hits it
      tangentB - (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 ellipse
      ellipseB - (Input) Second ellipse
      tangentA0 - (Output) Point on ellipseA in which tangent line0 passes through
      tangentA1 - (Output) Point on ellipseA in which tangent line1 passes through
      tangentA2 - (Output) Point on ellipseA in which tangent line2 passes through
      tangentA3 - (Output) Point on ellipseA in which tangent line3 passes through
      tangentB0 - (Output) Point on ellipseB in which tangent line0 passes through
      tangentB1 - (Output) Point on ellipseB in which tangent line1 passes through
      tangentB2 - (Output) Point on ellipseB in which tangent line2 passes through
      tangentB3 - (Output) Point on ellipseB in which tangent line3 passes through
      Returns:
      true if a solution was found or false if it failed
      See Also: