public final class Ellipse extends Area
| Modifier and Type | Field and Description |
|---|---|
static MessageSerializer<Ellipse> |
SERIALIZER |
| Constructor and Description |
|---|
Ellipse(Position geodeticReference,
double alpha,
double beta,
double thetaDeg)
Create an ellipse with center in the geodetic reference point.
|
Ellipse(Position geodeticReference,
double dx,
double dy,
double alpha,
double beta,
double thetaDeg)
Create an ellipse offset dx, dy meters from the geodetic reference point.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Position position) |
double |
getAlpha() |
double |
getBeta() |
Rectangle |
getBoundingBox()
Returns a bounding box of the area.
|
Position |
getGeodeticReference() |
double |
getMajorAxisGeodeticHeading() |
Position |
getRandomPosition(Random random)
Returns a random position within the area using a specified random source.
|
double |
getThetaDeg() |
double |
getX() |
double |
getY() |
Ellipse |
immutable()
Returns an immutable copy of this message.
|
boolean |
intersects(Area other) |
boolean |
intersects(Ellipse otherEllipse)
Returns true if two safety zones intersect.
|
List<Position> |
samplePerimeter(int n)
Sample the perimeter along the ellipse in 'n' points, and return a list of positions all located and evenly
distributed on the perimeter.
|
String |
toString() |
public static final MessageSerializer<Ellipse> SERIALIZER
public Ellipse(Position geodeticReference, double alpha, double beta, double thetaDeg)
geodeticReference - The center point of the ellipsealpha - Length of half axis in direction theta (in meters)beta - Length of half axis in direction orthogonal to theta (in meters)thetaDeg - Direction of half axis alpha measured in degrees; 0 degrees is parallel with the increasing direction
of the cartesian X axis.public Ellipse(Position geodeticReference, double dx, double dy, double alpha, double beta, double thetaDeg)
geodeticReference - The position, from which the center of the ellipse is offset by (dx, dy) meters.dx - dxdy - dyalpha - Length of half axis in direction theta (in meters)beta - Length of half axis in direction orthogonal to theta (in meters)thetaDeg - Direction of half axis alpha measured in degrees; 0 degrees is parallel with the increasing direction
of the cartesian X axis.public double getAlpha()
public double getBeta()
public Rectangle getBoundingBox()
getBoundingBox in class Areapublic Position getGeodeticReference()
public double getMajorAxisGeodeticHeading()
public Position getRandomPosition(Random random)
getRandomPosition in class Arearandom - the random sourcepublic double getThetaDeg()
public double getX()
public double getY()
public Ellipse immutable()
public boolean intersects(Area other)
intersects in class Areapublic boolean intersects(Ellipse otherEllipse)
otherEllipse - the other safety zone.public List<Position> samplePerimeter(int n)
n - the number of perimeter samples to return.Copyright © 2012–2015 Danish Maritime Authority. All rights reserved.