Constructor and Description |
---|
Ellipse(double x,
double y,
double major,
double minor,
double rotation)
Construct with centroid, semi-major and -minor axes, and rotation.
|
Modifier and Type | Method and Description |
---|---|
Polygon |
asPolygon()
Convert the shape to a polygon representation
|
double |
calculateArea()
Calculate the area of the shape
|
Point2d |
calculateCentroid()
Calculate the centroid of the shape
|
Polygon |
calculateOrientedBoundingBox()
Calculate the oriented bounding box.
|
double |
calculatePerimeter()
Calculate the perimeter of the shape
|
Rectangle |
calculateRegularBoundingBox()
Compute the regular (oriented to the axes) bounding box of the shape.
|
Ellipse |
clone() |
boolean |
equals(Object other) |
double |
getHeight() |
double |
getMajor() |
double |
getMinor() |
double |
getRotation() |
double |
getWidth() |
double |
intersectionArea(Shape that)
Calls
Polygon.intersectionArea(Shape, int) with 1 step per pixel
dimension. |
double |
intersectionArea(Shape that,
int nStepsPerDimension)
Return an estimate for the area of the intersection of this polygon and
another polygon.
|
boolean |
isConvex()
Test if the shape is convex.
|
boolean |
isInside(Point2d point)
Test whether the point p is inside the shape.
|
double |
maxX() |
double |
maxY() |
RotatedRectangle |
minimumBoundingRectangle()
Compute the minimum size rotated bounding rectangle that contains this
shape.
|
double |
minX() |
double |
minY() |
Jama.Matrix |
normTransformMatrix()
Get the normalised transform matrix such that the scale of this ellipse
is removed (i.e.
|
void |
scale(float sc)
Scale the shape by the given amount about (0,0).
|
void |
scale(Point2d centre,
float sc)
Scale the shape by the given amount about the given point.
|
void |
scaleCentroid(float sc)
Scale the shape about its centroid.
|
IndependentPair<Jama.Matrix,Double> |
secondMomentsAndScale() |
String |
toString() |
Shape |
transform(Jama.Matrix transform)
Apply a 3x3 transform matrix to a copy of the
GeometricObject and
return it |
Ellipse |
transformAffine(Jama.Matrix transform) |
Jama.Matrix |
transformAffineCovar(Jama.Matrix transform) |
Jama.Matrix |
transformMatrix()
Get the transform matrix required to turn points on a unit circle into
the points on this ellipse.
|
void |
translate(float x,
float y)
Translate the shapes position
|
public Ellipse(double x, double y, double major, double minor, double rotation)
x
- x-ordinate of centroidy
- y-ordinate of centroidmajor
- semi-major axis lengthminor
- semi-minor axis lengthrotation
- rotationpublic boolean isInside(Point2d point)
Shape
public Rectangle calculateRegularBoundingBox()
GeometricObject
calculateRegularBoundingBox
in interface GeometricObject
public Polygon calculateOrientedBoundingBox()
public void translate(float x, float y)
GeometricObject
translate
in interface GeometricObject
x
- x-translationy
- y-translationpublic void scale(float sc)
GeometricObject
scale
in interface GeometricObject
sc
- the scale factor.public void scale(Point2d centre, float sc)
GeometricObject
scale
in interface GeometricObject
centre
- the centre of the scaling operationsc
- the scale factorpublic void scaleCentroid(float sc)
GeometricObject
scaleCentroid
in interface GeometricObject
sc
- the scale factorpublic Point2d calculateCentroid()
GeometricObject
calculateCentroid
in interface GeometricObject
public double calculateArea()
Shape
calculateArea
in interface Shape
public double minX()
minX
in interface GeometricObject
public double minY()
minY
in interface GeometricObject
public double maxX()
maxX
in interface GeometricObject
public double maxY()
maxY
in interface GeometricObject
public double getWidth()
getWidth
in interface GeometricObject
public double getHeight()
getHeight
in interface GeometricObject
public Shape transform(Jama.Matrix transform)
Shape
GeometricObject
and
return ittransform
in interface GeometricObject
transform
in interface Shape
transform
- 3x3 transform matrixpublic Jama.Matrix transformAffineCovar(Jama.Matrix transform)
transform
- public Ellipse transformAffine(Jama.Matrix transform)
transform
- public Jama.Matrix normTransformMatrix()
public Jama.Matrix transformMatrix()
asPolygon()
public Polygon asPolygon()
Shape
public double intersectionArea(Shape that)
Shape
Polygon.intersectionArea(Shape, int)
with 1 step per pixel
dimension. Subsequently this function returns the shared whole pixels of
this polygon and that.intersectionArea
in interface Shape
public double intersectionArea(Shape that, int nStepsPerDimension)
Shape
intersectionArea
in interface Shape
public double getMinor()
public double getMajor()
public IndependentPair<Jama.Matrix,Double> secondMomentsAndScale()
public double getRotation()
public double calculatePerimeter()
Shape
calculatePerimeter
in interface Shape
public RotatedRectangle minimumBoundingRectangle()
Shape
minimumBoundingRectangle
in interface Shape