public class Circle extends Area
| Modifier and Type | Field and Description |
|---|---|
static MessageSerializer<Circle> |
SERIALIZER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Circle c) |
boolean |
contains(Position position) |
static Circle |
create(double latitude,
double longitude,
double radius) |
static Circle |
create(Position center,
double radius)
Creates a new circle with the specified center and radius.
|
boolean |
equals(Circle other) |
boolean |
equals(Object other)
Equals method
|
static Circle |
fromJSON(CharSequence string)
Creates a message of this type from a JSON.
|
double |
geodesicDistanceTo(Position other) |
Rectangle |
getBoundingBox()
Returns a bounding box of the area.
|
Position |
getCenter()
Return the center of the circle.
|
double |
getRadius()
Returns the radius of the circle.
|
Position |
getRandomPosition(Random r)
Returns a random position within the area using a specified random source.
|
int |
hashCode() |
Circle |
immutable()
Returns an immutable copy of this message.
|
boolean |
intersects(Area other) |
boolean |
intersects(Circle other) |
boolean |
intersects(Line line) |
boolean |
intersects(Rectangle other) |
static Circle |
random()
Returns a random valid circle.
|
static Circle |
random(Random rnd)
Returns a random valid circle.
|
double |
rhumbLineDistanceTo(Position position) |
String |
toString() |
Circle |
withCenter(Position center)
Returns a new circle with the same radius as this circle but with the new position as the center
|
Circle |
withRadius(double radius)
Returns a new circle with the same center as this circle but with the new radius.
|
public static final MessageSerializer<Circle> SERIALIZER
public boolean contains(Circle c)
public boolean equals(Circle other)
public double geodesicDistanceTo(Position other)
public Rectangle getBoundingBox()
getBoundingBox in class Areapublic Position getCenter()
public double getRadius()
public Position getRandomPosition(Random r)
getRandomPosition in class Arear - the random sourcepublic Circle immutable()
public boolean intersects(Area other)
intersects in class Areapublic boolean intersects(Circle other)
public boolean intersects(Line line)
public boolean intersects(Rectangle other)
public double rhumbLineDistanceTo(Position position)
public Circle withCenter(Position center)
center - the new center of the circlepublic Circle withRadius(double radius)
radius - the new radius of the circlepublic static Circle create(double latitude, double longitude, double radius)
public static Circle create(Position center, double radius)
center - the center of the circleradius - the radius in meters of the circleNullPointerException - if the specified center is nullIllegalArgumentException - if the specified is not a positive numberpublic static Circle fromJSON(CharSequence string)
string - the JSON string to parsepublic static Circle random()
Copyright © 2012–2015 Danish Maritime Authority. All rights reserved.