Package com.kheops.jmap.spatial
Class Ellipse
java.lang.Object
com.kheops.jmap.spatial.DefaultGeometry
com.kheops.jmap.spatial.Ellipse
- All Implemented Interfaces:
EllipseTypeGeometry,Geometry,Surface,Serializable,Cloneable
- See Also:
-
Field Summary
Fields inherited from interface com.kheops.jmap.spatial.Geometry
GEOMETRY_ANNOTATION, GEOMETRY_COMPLEX, GEOMETRY_ELLIPSE, GEOMETRY_LINE, GEOMETRY_LINEAR_RING, GEOMETRY_LINESTRING, GEOMETRY_MULTI_ANNOTATION, GEOMETRY_MULTI_LINESTRING, GEOMETRY_MULTI_POINT, GEOMETRY_MULTI_POLYGON, GEOMETRY_POINT, GEOMETRY_POLYGON, GEOMETRY_RECTANGLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublearea()Computes and returns the surface area.boundary()Returns the boundary of this geometry as a line string.centroid()Returns the centroid of the current surface.clone()Clones this geometry.Point[]computeEndPoints(double a, double b, double cosTheta, double sinTheta) Point[]computeFocusPoints(double a, double b, double cosTheta, double sinTheta) voidUpdates the geometry bounds from the current geometry.booleanfloatgetAngle()Returns the minimum bounding rectangle of this geometry.This method returns a point that is typically centered on the geometry.getCoord()Returns the ellipse origin.
Note that the origin may not be included in the ellipse surface.shortReturns the geometry class id.intReturns the geometry type for this geometry.inthashCode()doublelength()Returns the perimeter approximation, according to Ramanujan's formula.Returns a point that is located in the interior of this surface geometry.Point[]Returns this geometry as an array of Point.voidvoidsetSemiAxes(Dimension semiAxes) intsizeOf()Returns an approximation in bytes of the memory used by this geometry.booleanspatiallyEquals(Geometry geometry, PrecisionModel precisionModel) Tests if this geometry is equal to the argument, on a topological point of view.toString()Returns information about the current geometry.Creates a clone of the current geometry and returns the new instance transformed with the specified geometry transformation.
The returned geometry can be of any geometry types after the transformation.voidtranslate(double dx, double dy) Translate this geometry with the specified values.Methods inherited from class com.kheops.jmap.spatial.DefaultGeometry
asText, spatiallyEqualsMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.kheops.jmap.spatial.Geometry
asText, spatiallyEquals
-
Constructor Details
-
Ellipse
Creates a new Ellipse using the specified parameters.- Parameters:
coord- the ellipse origin.semiAxes- the radius of the two axes.angle- the ellipse angle.
-
-
Method Details
-
clone
Clones this geometry.- Specified by:
clonein interfaceGeometry- Specified by:
clonein classDefaultGeometry- Returns:
- a deep copy of the current geometry.
-
ellipseIterator
- Specified by:
ellipseIteratorin interfaceEllipseTypeGeometry- Returns:
-
getGeometryId
public short getGeometryId()Returns the geometry class id. This method is useful for geometry serialization.- Specified by:
getGeometryIdin interfaceGeometry- Returns:
- the geometry id.
-
getGeometryType
public int getGeometryType()Returns the geometry type for this geometry.- Specified by:
getGeometryTypein interfaceGeometry- Returns:
- the geometry type.
- See Also:
-
boundary
Returns the boundary of this geometry as a line string. -
createBounds
public void createBounds()Description copied from interface:GeometryUpdates the geometry bounds from the current geometry.- Specified by:
createBoundsin interfaceGeometry
-
getBounds
Returns the minimum bounding rectangle of this geometry. -
getCenteredPoint
This method returns a point that is typically centered on the geometry. If the geometry is a point, the point is returned. If it is a line, a point on the curve interpolated at 50% is returned. If the geometry is a surface, the centroid is returned if it is inside the polygon, if not, a point inside the polygon (but likely not exactly in the center) will be returned. If the geometry is a collection, the method is called on the first part of the collection.- Specified by:
getCenteredPointin interfaceGeometry- Returns:
- a point likely at the center of the geometry
-
serialize
Returns this geometry as an array of Point. -
hashCode
public int hashCode() -
equals
-
spatiallyEquals
Tests if this geometry is equal to the argument, on a topological point of view.- Specified by:
spatiallyEqualsin interfaceGeometry- Parameters:
geometry- the geometry to be tested.precisionModel- the precision model to use while comparing geometries.- Returns:
- whether both geometries are spatially equals.
-
transform
Creates a clone of the current geometry and returns the new instance transformed with the specified geometry transformation.
The returned geometry can be of any geometry types after the transformation. -
translate
public void translate(double dx, double dy) Translate this geometry with the specified values. -
area
public double area()Computes and returns the surface area. -
length
public double length()Returns the perimeter approximation, according to Ramanujan's formula. https://www.mathsisfun.com/geometry/ellipse-perimeter.html. -
centroid
Returns the centroid of the current surface.- Specified by:
centroidin interfaceEllipseTypeGeometry- Specified by:
centroidin interfaceSurface- Returns:
- the centroid.
-
pointOnSurface
Returns a point that is located in the interior of this surface geometry.- Specified by:
pointOnSurfacein interfaceEllipseTypeGeometry- Specified by:
pointOnSurfacein interfaceSurface- Returns:
- a point on thge surface.
-
getAngle
public float getAngle()- Returns:
- Returns the angle.
-
getSemiAxes
- Returns:
- Returns the semiAxes.
-
setSemiAxes
-
getCoord
Returns the ellipse origin.
Note that the origin may not be included in the ellipse surface.- Returns:
- the ellipse origin.
-
setCoord
-
computeFocusPoints
-
computeEndPoints
-
toPolygon
-
toString
Description copied from interface:GeometryReturns information about the current geometry. -
sizeOf
public int sizeOf()Returns an approximation in bytes of the memory used by this geometry.
-