Class UtilEllipse_F32

java.lang.Object
georegression.geometry.UtilEllipse_F32

@Generated("georegression.geometry.UtilEllipse_F64") public class UtilEllipse_F32 extends Object
Functions for extracting information from ellipses and converting between different ellipse formats.
  • Constructor Details

    • UtilEllipse_F32

      public UtilEllipse_F32()
  • Method Details

    • convert

      public static EllipseRotated_F32 convert(EllipseQuadratic_F32 input, @Nullable @Nullable EllipseRotated_F32 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_F32 convert(EllipseRotated_F32 input, @Nullable @Nullable EllipseQuadratic_F32 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 float evaluate(float x, float y, EllipseQuadratic_F32 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 float evaluate(float x, float y, EllipseRotated_F32 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_F32 computePoint(float t, EllipseRotated_F32 ellipse, @Nullable @Nullable Point2D_F32 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 float computeAngle(Point2D_F32 p, EllipseRotated_F32 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_F32 computeTangent(float t, EllipseRotated_F32 ellipse, @Nullable @Nullable Vector2D_F32 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_F32 pt, EllipseRotated_F32 ellipse, Point2D_F32 tangentA, Point2D_F32 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_F32 ellipseA, EllipseRotated_F32 ellipseB, Point2D_F32 tangentA0, Point2D_F32 tangentA1, Point2D_F32 tangentA2, Point2D_F32 tangentA3, Point2D_F32 tangentB0, Point2D_F32 tangentB1, Point2D_F32 tangentB2, Point2D_F32 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: