Class Ellipse

java.lang.Object
com.irurueta.geometry.Ellipse
All Implemented Interfaces:
Serializable

public class Ellipse extends Object implements Serializable
This class defines an ellipse. This class uses formulas as defined at: https://en.wikipedia.org/wiki/Ellipse
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Point2D
    Center of ellipse.
    static final double
    Constant defining default threshold value used when none is provided.
    static final double
    Constant defining minimum allowed threshold.
    private double
    Rotation angle.
    private double
    Semi-major axis length (a).
    private double
    Semi-minor axis length (b).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor.
    Ellipse(double a, double b, double c, double d, double e, double f)
    Constructor setting parameters of canonical equation of an ellipse, which is: a*x^2 + b*x*y + c*y^2 + d*x + e*y + f = 0
    Ellipse(double a, double b, double c, double d, double e, double f, double threshold)
    Constructor setting parameters of canonical equation of an ellipse, which is: a*x^2 + b*x*y + c*y^2 + d*x + e*y + f = 0
    Ellipse(Circle circle)
    Constructor.
    Ellipse(Conic conic)
    Constructor.
    Ellipse(Point2D center, double semiMajorAxis, double semiMinorAxis, double rotationAngle)
    Constructor.
    Ellipse(Point2D center, double semiMajorAxis, double semiMinorAxis, Rotation2D rotation)
    Constructor.
    Ellipse(Point2D point1, Point2D point2, Point2D center, double theta)
    Constructor from 2 points, ellipse center and rotation.
    Ellipse(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5)
    Constructor from 5 points.
    Ellipse(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, double threshold)
    Constructor from 5 points.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets parameter A of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    double
    Returns area of this ellipse.
    double
    Gets parameter B of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    double
    Gets parameter C of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    Returns center of ellipse.
    double
    Gets curvature of ellipse at provided point.
    double
    Gets parameter D of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    double
    Gets parameter E of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    double
    Gets eccentricity of ellipsis.
    double
    Gets parameter F of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    double
    Gets focus distance of ellipse.
    Gets 1st focus point.
    void
    getFocusPoint1(Point2D focusPoint1)
    Gets 1st focus point.
    Gets 2nd focus point.
    void
    getFocusPoint2(Point2D focusPoint2)
    Gets 2nd focus point.
    double
    Returns perimeter of this ellipse.
    Gets 2D rotation.
    double
    Gets rotation angle expressed in radians.
    double
    Gets semi-major axis length.
    double[]
    Gets semi major axis x,y coordinates.
    void
    getSemiMajorAxisCoordinates(double[] coords)
    Gets semi major axis x,y coordinates.
    double
    Gets semi-minor axis length.
    double[]
    Gets semi minor axis x,y coordinates.
    void
    getSemiMinorAxisCoordinates(double[] coords)
    Gets semi minor axis x,y coordinates.
    Returns a line tangent to this ellipse at provided point.
    getTangentLineAt(Point2D point, double threshold)
    Returns a line tangent to this ellipse at provided point.
    boolean
    Determines if provided point is inside this circle or not.
    boolean
    isInside(Point2D point, double threshold)
    Determines if provided point is inside this ellipse or not up to a certain threshold.
    boolean
    Determines whether provided point lies at ellipse boundary or not.
    boolean
    isLocus(Point2D point, double threshold)
    Determines whether provided point lies at ellipse boundary or not up to a certain threshold.
    void
    setA(double a)
    Sets parameter A of canonical ellipse equation.
    void
    setB(double b)
    Sets parameter B of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    void
    setC(double c)
    Sets parameter C of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    void
    Sets center of ellipse.
    final void
    setCenterAxesAndRotation(Point2D center, double semiMajorAxis, double semiMinorAxis, double rotationAngle)
    Sets ellipse parameters.
    final void
    setCenterAxesAndRotation(Point2D center, double semiMajorAxis, double semiMinorAxis, Rotation2D rotation)
    Sets ellipse parameters.
    void
    setD(double d)
    Sets parameter D of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    void
    setE(double e)
    Sets parameter E of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
    void
    setF(double f)
    Sets parameter F of canonical ellipse equation.
    void
    setFocusPoints(Point2D focusPoint1, Point2D focusPoint2, boolean keepSemiMinorAxis)
    Sets focus points.
    final void
    Sets parameters of this ellipse from a circle.
    final void
    Set parameters of this circle from a valid conic corresponding to a circle.
    final void
    setParameters(double a, double b, double c, double d, double e, double f)
    Sets parameters of canonical equation of an ellipse, which is: a*x^2 + b*x*y + c*y^2 + d*x + e*y + f = 0
    final void
    setParameters(double a, double b, double c, double d, double e, double f, double threshold)
    Sets parameters of canonical equation of an ellipse, which is: a*x^2 + b*x*y + c*y^2 + d*x + e*y + f = 0
    final void
    setParametersFromPoints(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5)
    Sets parameters from 5 points.
    final void
    setParametersFromPoints(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, double threshold)
    Sets parameters from 5 points.
    final void
    setParametersFromPointsCenterAndRotation(Point2D point1, Point2D point2, Point2D center, double theta)
    Sets parameters from 2 points, ellipse center and rotation.
    void
    Sets 2D rotation.
    void
    setRotationAngle(double rotationAngle)
    Sets rotation angle expressed in radians.
    void
    setSemiMajorAxis(double semiMajorAxis)
    Sets semi-major axis length.
    void
    setSemiMajorAxisCoordinates(double[] coords)
    Sets semi major axis coordinates.
    void
    setSemiMinorAxis(double semiMinorAxis)
    Sets semi-minor axis length.
    void
    setSemiMinorAxisCoordinates(double[] coords)
    Sets semi minor axis coordinates.
    void
    tangentLineAt(Point2D point, Line2D line, double threshold)
    Computes a line tangent to this circle at provided point.
    Converts this circle into a conic.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_THRESHOLD

      public static final double DEFAULT_THRESHOLD
      Constant defining default threshold value used when none is provided.
      See Also:
    • MIN_THRESHOLD

      public static final double MIN_THRESHOLD
      Constant defining minimum allowed threshold.
      See Also:
    • center

      private Point2D center
      Center of ellipse.
    • semiMajorAxis

      private double semiMajorAxis
      Semi-major axis length (a).
    • semiMinorAxis

      private double semiMinorAxis
      Semi-minor axis length (b).
    • rotationAngle

      private double rotationAngle
      Rotation angle.
  • Constructor Details

    • Ellipse

      public Ellipse()
      Empty constructor. Creates an ellipse equal to a circle located at space origin (0,0) with radius 1.0.
    • Ellipse

      public Ellipse(Point2D center, double semiMajorAxis, double semiMinorAxis, double rotationAngle)
      Constructor.
      Parameters:
      center - center of ellipse.
      semiMajorAxis - semi-major axis length.
      semiMinorAxis - semi-minor axis length.
      rotationAngle - rotation angle expressed in radians.
    • Ellipse

      public Ellipse(Point2D center, double semiMajorAxis, double semiMinorAxis, Rotation2D rotation)
      Constructor.
      Parameters:
      center - center of ellipse.
      semiMajorAxis - semi-major axis length.
      semiMinorAxis - semi-minor axis length.
      rotation - 2D rotation.
    • Ellipse

      public Ellipse(Point2D point1, Point2D point2, Point2D center, double theta) throws ColinearPointsException
      Constructor from 2 points, ellipse center and rotation.
      Parameters:
      point1 - 1st point.
      point2 - 2nd point.
      center - center of ellipse.
      theta - rotation angle expressed in radians.
      Throws:
      ColinearPointsException - if points are in a co-linear or degenerate configuration.
    • Ellipse

      public Ellipse(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5) throws ColinearPointsException
      Constructor from 5 points.
      Parameters:
      point1 - 1st point.
      point2 - 2nd point.
      point3 - 3rd point.
      point4 - 4th point.
      point5 - 5th point.
      Throws:
      ColinearPointsException - if points are in a co-linear or degenerate configuration.
    • Ellipse

      public Ellipse(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, double threshold) throws ColinearPointsException
      Constructor from 5 points.
      Parameters:
      point1 - 1st point.
      point2 - 2nd point.
      point3 - 3rd point.
      point4 - 4th point.
      point5 - 5th point.
      threshold - threshold to determine whether points form an ellipse. This is usually a very small value
      Throws:
      ColinearPointsException - if points are in a co-linear or degenerate configuration.
    • Ellipse

      public Ellipse(double a, double b, double c, double d, double e, double f)
      Constructor setting parameters of canonical equation of an ellipse, which is: a*x^2 + b*x*y + c*y^2 + d*x + e*y + f = 0
      Parameters:
      a - a parameter.
      b - b parameter.
      c - c parameter.
      d - d parameter.
      e - e parameter.
      f - f parameter.
      Throws:
      IllegalArgumentException - if parameters do not follow b^2 - 4*a*c < 0.0
    • Ellipse

      public Ellipse(double a, double b, double c, double d, double e, double f, double threshold)
      Constructor setting parameters of canonical equation of an ellipse, which is: a*x^2 + b*x*y + c*y^2 + d*x + e*y + f = 0
      Parameters:
      a - a parameter.
      b - b parameter.
      c - c parameter.
      d - d parameter.
      e - e parameter.
      f - f parameter.
      threshold - threshold to determine whether parameters are valid due to machine precision.
      Throws:
      IllegalArgumentException - if parameters do not follow b^2 - 4*A*c < threshold
    • Ellipse

      public Ellipse(Conic conic)
      Constructor.
      Parameters:
      conic - conic to build ellipse from.
      Throws:
      IllegalArgumentException - if provided conic is not an ellipse.
    • Ellipse

      public Ellipse(Circle circle)
      Constructor.
      Parameters:
      circle - a circle to set parameters from.
  • Method Details

    • getCenter

      public Point2D getCenter()
      Returns center of ellipse.
      Returns:
      center of ellipse.
    • setCenter

      public void setCenter(Point2D center)
      Sets center of ellipse.
      Parameters:
      center - center of ellipse.
      Throws:
      NullPointerException - raised if provided center is null.
    • getSemiMajorAxis

      public double getSemiMajorAxis()
      Gets semi-major axis length.
      Returns:
      semi-major axis length.
    • setSemiMajorAxis

      public void setSemiMajorAxis(double semiMajorAxis)
      Sets semi-major axis length.
      Parameters:
      semiMajorAxis - semi-major axis length.
    • getSemiMinorAxis

      public double getSemiMinorAxis()
      Gets semi-minor axis length.
      Returns:
      semi-minor axis length.
    • setSemiMinorAxis

      public void setSemiMinorAxis(double semiMinorAxis)
      Sets semi-minor axis length.
      Parameters:
      semiMinorAxis - semi-minor axis length.
    • getRotationAngle

      public double getRotationAngle()
      Gets rotation angle expressed in radians.
      Returns:
      rotation angle expressed in radians.
    • setRotationAngle

      public void setRotationAngle(double rotationAngle)
      Sets rotation angle expressed in radians.
      Parameters:
      rotationAngle - rotation angle expressed in radians.
    • getRotation

      public Rotation2D getRotation()
      Gets 2D rotation.
      Returns:
      2D rotation.
    • setRotation

      public void setRotation(Rotation2D rotation)
      Sets 2D rotation.
      Parameters:
      rotation - 2D rotation to be set.
    • getA

      public double getA()
      Gets parameter A of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Returns:
      parameter A.
    • setA

      public void setA(double a)
      Sets parameter A of canonical ellipse equation. A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Parameters:
      a - parameter A to be set.
    • getB

      public double getB()
      Gets parameter B of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Returns:
      parameter B.
    • setB

      public void setB(double b)
      Sets parameter B of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Parameters:
      b - parameter B to be set.
    • getC

      public double getC()
      Gets parameter C of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Returns:
      parameter C.
    • setC

      public void setC(double c)
      Sets parameter C of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Parameters:
      c - parameter C to be set.
    • getD

      public double getD()
      Gets parameter D of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Returns:
      parameter D.
    • setD

      public void setD(double d)
      Sets parameter D of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Parameters:
      d - parameter D to be set.
    • getE

      public double getE()
      Gets parameter E of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Returns:
      parameter E.
    • setE

      public void setE(double e)
      Sets parameter E of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Parameters:
      e - parameter E to be set.
    • getF

      public double getF()
      Gets parameter F of canonical ellipse equation: A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Returns:
      parameter F.
    • setF

      public void setF(double f)
      Sets parameter F of canonical ellipse equation. A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0
      Parameters:
      f - parameter F to be set.
    • setCenterAxesAndRotation

      public final void setCenterAxesAndRotation(Point2D center, double semiMajorAxis, double semiMinorAxis, double rotationAngle)
      Sets ellipse parameters.
      Parameters:
      center - center of ellipse.
      semiMajorAxis - semi-major axis length.
      semiMinorAxis - semi-minor axis length.
      rotationAngle - rotation angle expressed in radians.
    • setCenterAxesAndRotation

      public final void setCenterAxesAndRotation(Point2D center, double semiMajorAxis, double semiMinorAxis, Rotation2D rotation)
      Sets ellipse parameters.
      Parameters:
      center - center of ellipse.
      semiMajorAxis - semi-major axis length.
      semiMinorAxis - semi-minor axis length.
      rotation - 2D rotation.
    • setParametersFromPointsCenterAndRotation

      public final void setParametersFromPointsCenterAndRotation(Point2D point1, Point2D point2, Point2D center, double theta) throws ColinearPointsException
      Sets parameters from 2 points, ellipse center and rotation.
      Parameters:
      point1 - 1st point.
      point2 - 2nd point.
      center - center of ellipse.
      theta - rotation angle expressed in radians.
      Throws:
      ColinearPointsException - if points are in a co-linear or degenerate configuration.
    • setParametersFromPoints

      public final void setParametersFromPoints(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5) throws ColinearPointsException
      Sets parameters from 5 points.
      Parameters:
      point1 - 1st point.
      point2 - 2nd point.
      point3 - 3rd point.
      point4 - 4th point.
      point5 - 5th point.
      Throws:
      ColinearPointsException - if points are in a co-linear or degenerate configuration.
    • setParametersFromPoints

      public final void setParametersFromPoints(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, double threshold) throws ColinearPointsException
      Sets parameters from 5 points.
      Parameters:
      point1 - 1st point.
      point2 - 2nd point.
      point3 - 3rd point.
      point4 - 4th point.
      point5 - 5th point.
      threshold - threshold to determine whether points form an ellipse. This is usually a very small value
      Throws:
      ColinearPointsException - if points are in a co-linear or degenerate configuration.
    • setParameters

      public final void setParameters(double a, double b, double c, double d, double e, double f)
      Sets parameters of canonical equation of an ellipse, which is: a*x^2 + b*x*y + c*y^2 + d*x + e*y + f = 0
      Parameters:
      a - a parameter.
      b - b parameter.
      c - c parameter.
      d - d parameter.
      e - e parameter.
      f - f parameter.
      Throws:
      IllegalArgumentException - if parameters do not follow b^2 - 4*a*c < 0.0.
    • setParameters

      public final void setParameters(double a, double b, double c, double d, double e, double f, double threshold)
      Sets parameters of canonical equation of an ellipse, which is: a*x^2 + b*x*y + c*y^2 + d*x + e*y + f = 0
      Parameters:
      a - a parameter.
      b - b parameter.
      c - c parameter.
      d - d parameter.
      e - e parameter.
      f - f parameter.
      threshold - threshold to determine whether parameters are valid due to machine precision.
      Throws:
      IllegalArgumentException - if parameters do not follow b^2 - 4*A*c < threshold.
    • getFocus

      public double getFocus()
      Gets focus distance of ellipse. Focus determines the distance respect to the center of the ellipse where the two focus points are located. The sum of the distances from any point P = P(x,y) on the ellipse to those two foci is constant and equal to the major axis length.
      Returns:
      focus distance.
    • getSemiMajorAxisCoordinates

      public void getSemiMajorAxisCoordinates(double[] coords)
      Gets semi major axis x,y coordinates.
      Parameters:
      coords - array where x, y coordinates of semi major axis will be stored.
    • getSemiMajorAxisCoordinates

      public double[] getSemiMajorAxisCoordinates()
      Gets semi major axis x,y coordinates.
      Returns:
      array containing x, y coordinates of semi major axis.
    • setSemiMajorAxisCoordinates

      public void setSemiMajorAxisCoordinates(double[] coords)
      Sets semi major axis coordinates. This method updates rotation angle and semi major axis length.
      Parameters:
      coords - coordinates of semi major axis.
    • getSemiMinorAxisCoordinates

      public void getSemiMinorAxisCoordinates(double[] coords)
      Gets semi minor axis x,y coordinates.
      Parameters:
      coords - array where x, y coordinates of semi minor axis will be stored.
    • getSemiMinorAxisCoordinates

      public double[] getSemiMinorAxisCoordinates()
      Gets semi minor axis x,y coordinates.
      Returns:
      array containing x,y coordinates of semi minor axis.
    • setSemiMinorAxisCoordinates

      public void setSemiMinorAxisCoordinates(double[] coords)
      Sets semi minor axis coordinates. This method updates rotation angle and semi minor axis length.
      Parameters:
      coords - coordinates of semi minor axis.
    • getFocusPoint1

      public void getFocusPoint1(Point2D focusPoint1)
      Gets 1st focus point. The sum of the distances from any point P = P(x,y) on the ellipse to this focus is constant and equal to the major axis length.
      Parameters:
      focusPoint1 - 1st focus point.
    • getFocusPoint1

      public Point2D getFocusPoint1()
      Gets 1st focus point. The sum of the distances from any point P = P(x,y) on the ellipse to this focus is constant and equal to the major axis length.
      Returns:
      1st focus point.
    • getFocusPoint2

      public void getFocusPoint2(Point2D focusPoint2)
      Gets 2nd focus point. The sum of the distances from any point P = P(x,y) on the ellipse to this focus is constant and equal to the major axis length.
      Parameters:
      focusPoint2 - 2nd focus point.
    • getFocusPoint2

      public Point2D getFocusPoint2()
      Gets 2nd focus point. The sum of the distances from any point P = P(x,y) on the ellipse to this focus is constant and equal to the major axis length.
      Returns:
      2nd focus point.
    • setFocusPoints

      public void setFocusPoints(Point2D focusPoint1, Point2D focusPoint2, boolean keepSemiMinorAxis)
      Sets focus points.
      Parameters:
      focusPoint1 - 1st focus point.
      focusPoint2 - 2nd focus point.
      keepSemiMinorAxis - true indicates that semi-minor axis is kept, false indicates that semi-major axis is kept instead.
    • getEccentricity

      public double getEccentricity()
      Gets eccentricity of ellipsis.
      Returns:
      eccentricity of ellipsis.
    • getArea

      public double getArea()
      Returns area of this ellipse.
      Returns:
      area of this ellipse.
    • getPerimeter

      public double getPerimeter()
      Returns perimeter of this ellipse.
      Returns:
      Perimeter of this ellipse.
    • getCurvature

      public double getCurvature(Point2D point)
      Gets curvature of ellipse at provided point.
      Parameters:
      point - point to be checked.
      Returns:
      curvature of ellipse.
    • toConic

      public Conic toConic()
      Converts this circle into a conic. Conics are a more general representation of circles.
      Returns:
      A conic representing this circle
    • setFromConic

      public final void setFromConic(Conic conic)
      Set parameters of this circle from a valid conic corresponding to a circle.
      Parameters:
      conic - conic to set parameters from.
      Throws:
      IllegalArgumentException - if provided conic is not an ellipse.
    • setFromCircle

      public final void setFromCircle(Circle circle)
      Sets parameters of this ellipse from a circle.
      Parameters:
      circle - a circle to set parameters from.
    • isInside

      public boolean isInside(Point2D point, double threshold)
      Determines if provided point is inside this ellipse or not up to a certain threshold. If provided threshold is positive, the ellipse behaves as if it was a larger ellipse increased by threshold amount, if provided threshold is negative, the ellipse behaves as if it was a smaller ellipse decreased by threshold amount in radius.
      Parameters:
      point - Point to be checked.
      threshold - Threshold to determine if point is inside or not.
      Returns:
      True if point is considered to be inside this circle, false otherwise.
    • isInside

      public boolean isInside(Point2D point)
      Determines if provided point is inside this circle or not.
      Parameters:
      point - Point to be checked.
      Returns:
      True if point is considered to be inside this circle, false otherwise.
    • isLocus

      public boolean isLocus(Point2D point, double threshold)
      Determines whether provided point lies at ellipse boundary or not up to a certain threshold.
      Parameters:
      point - Point to be checked.
      threshold - A small threshold to determine whether point lies at ellipse boundary.
      Returns:
      True if point lies at ellipse boundary, false otherwise.
      Throws:
      IllegalArgumentException - Raised if provided threshold is negative.
    • isLocus

      public boolean isLocus(Point2D point)
      Determines whether provided point lies at ellipse boundary or not.
      Parameters:
      point - Point to be checked.
      Returns:
      True if point lies at ellipse boundary, false otherwise.
    • getTangentLineAt

      public Line2D getTangentLineAt(Point2D point) throws NotLocusException
      Returns a line tangent to this ellipse at provided point. Provided point must be locus of this ellipse, otherwise a NotLocusException will be thrown.
      Parameters:
      point - a locus point of this ellipse.
      Returns:
      a 2D line tangent to this ellipse at provided point.
      Throws:
      NotLocusException - if provided point is not locus of this ellipse up to DEFAULT_THRESHOLD.
    • getTangentLineAt

      public Line2D getTangentLineAt(Point2D point, double threshold) throws NotLocusException
      Returns a line tangent to this ellipse at provided point. Provided point must be locus of this ellipse, otherwise a NotLocusException will be thrown.
      Parameters:
      point - a locus point of this circle.
      threshold - threshold to determine if provided point is locus.
      Returns:
      a 2D line tangent to this circle at provided point.
      Throws:
      NotLocusException - if provided point is not locus of this circle up to provided threshold.
      IllegalArgumentException - if provided threshold is negative.
    • tangentLineAt

      public void tangentLineAt(Point2D point, Line2D line, double threshold) throws NotLocusException
      Computes a line tangent to this circle at provided point. Provided point must be locus of this circle, otherwise a NotLocusException will be thrown.
      Parameters:
      point - a locus point of this circle.
      line - instance of a 2D line where result will be stored.
      threshold - threshold to determine if provided point is locus.
      Throws:
      NotLocusException - if provided point is not locus of this circle up to provided threshold.
      IllegalArgumentException - if provided threshold is negative.