Class EllipseStandardFormConverter
Object
EllipseStandardFormConverter
Extracts forms for 'standard form' representation of an ellipse from the coefficients for a 2nd
 order polynomial describing the ellipse.
 
SEE 'Information About Ellipses' by Eberly (URL below) http://www.geometrictools.com/Documentation/InformationAboutEllipses.pdf
See Matlab Prototype (ls_ellipse/convert_to_standard_form.m)
The matrix coefficients are as follows (in a vector):
- 0 = x^2
- 1 = xy/2
- 2 = y^2
- 3 = x
- 4 = y
- 5 = c
- 
Constructor SummaryConstructorsConstructorDescriptionEllipseStandardFormConverter(cern.colt.matrix.DoubleMatrix1D matrix) Creates a newEllipseStandardFormConverterand performs the conversion.
- 
Method SummaryModifier and TypeMethodDescriptionstatic doubleatanHandlingNan(double val) Calculates the arctangent, handling NaN values.Gets the center point of the ellipse.doubleGets the x-coordinate of the ellipse's center point.doubleGets the y-coordinate of the ellipse's center point.doubleGets the angle of the major axis in radians.doubleGets the slope of the major axis.doubleGets the angle of the minor axis in radians.doubleGets the slope of the minor axis.doubleGets the length of the semi-major axis.doubleGets the length of the semi-minor axis.
- 
Constructor Details- 
EllipseStandardFormConverterCreates a newEllipseStandardFormConverterand performs the conversion.- Parameters:
- matrix- the matrix of coefficients describing the ellipse
- Throws:
- CreateException- if the matrix does not describe an ellipse
 
 
- 
- 
Method Details- 
getCenterPointXpublic double getCenterPointX()Gets the x-coordinate of the ellipse's center point.- Returns:
- the x-coordinate of the center point
 
- 
getCenterPointYpublic double getCenterPointY()Gets the y-coordinate of the ellipse's center point.- Returns:
- the y-coordinate of the center point
 
- 
centerPointGets the center point of the ellipse.- Returns:
- a Point2drepresenting the center point
 
- 
getSemiMajorAxispublic double getSemiMajorAxis()Gets the length of the semi-major axis.- Returns:
- the length of the semi-major axis
 
- 
getSemiMinorAxispublic double getSemiMinorAxis()Gets the length of the semi-minor axis.- Returns:
- the length of the semi-minor axis
 
- 
getMajorAxisAnglepublic double getMajorAxisAngle()Gets the angle of the major axis in radians.- Returns:
- the angle of the major axis
 
- 
getMinorAxisAnglepublic double getMinorAxisAngle()Gets the angle of the minor axis in radians.- Returns:
- the angle of the minor axis
 
- 
atanHandlingNanpublic static double atanHandlingNan(double val) Calculates the arctangent, handling NaN values.- Parameters:
- val- the value to calculate arctangent for
- Returns:
- the arctangent in radians, or PI/2 if the input is NaN
 
- 
getMajorAxisSlopepublic double getMajorAxisSlope()Gets the slope of the major axis.- Returns:
- the slope of the major axis
 
- 
getMinorAxisSlopepublic double getMinorAxisSlope()Gets the slope of the minor axis.- Returns:
- the slope of the minor axis
 
 
-