Class EllipseProjector

java.lang.Object
imagingbook.common.geometry.ellipse.project.EllipseProjector
Direct Known Subclasses:
ConfocalConicEllipseProjector, OrthogonalEllipseProjector, OrthogonalEllipseProjectorNewton

public abstract class EllipseProjector extends Object

Abstract superclass for ellipse projectors, used to find the closest "contact" point on an ellipse for some given target point. Defines specific methods for calculating minimum distance only, i.e., without returning the closest point itself. All calculations are performed in a "canonical" coordinate frame, with the ellipse centered at the origin and its major axis aligned to the x-axis. See Sec. 11.2.2 (Fig. 11.7) of [1] for details.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/11/17
  • Constructor Details

  • Method Details

    • projectCanonical

      protected abstract double[] projectCanonical(double[] u1)
      Calculates the projection point in canonical coordinates.
      Parameters:
      u1 - target point in canonical coordinates.
      Returns:
      the associated "contact" point on the ellipse
    • project

      public double[] project(double[] x)
      Projects the specified point onto the associated ellipse.
      Parameters:
      x - the 2D point to be projected
      Returns:
      the closest point on the ellipse
    • project

      public Pnt2d project(Pnt2d pnt)
      Projects the specified point onto the associated ellipse.
      Parameters:
      pnt - the 2D point to be projected
      Returns:
      the closest point on the ellipse
    • getDistance

      public double getDistance(double[] x)
      Calculates the distance to the closest ellipse point (but not the point itself).
      Parameters:
      x - the 2D point to be projected
      Returns:
      the distance to the closest ellipse point
    • getDistanceSq

      public double getDistanceSq(double[] x)
    • toCanonicalFrame

      protected double[] toCanonicalFrame(double[] xy)
    • fromCanonicalFrame

      protected double[] fromCanonicalFrame(double[] uv)
    • toFirstQuadrant

      protected double[] toFirstQuadrant(double[] uv)
    • fromFirstQuadrant

      protected double[] fromFirstQuadrant(double[] uv, double[] uvOrig)