|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.viper.geometry.Ellipse
An ellipse. It does not support the functions necessary for advanced comparison (union, etc.) yet.
Field Summary |
Fields inherited from interface edu.umd.cfar.lamp.viper.geometry.Moveable |
EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, WEST |
Constructor Summary | |
Ellipse()
Constructs a new null ellipse |
|
Ellipse(Ellipse old)
Copy constructor. |
|
Ellipse(int x,
int y,
int width,
int height,
int rotation)
Constructs a new ellipse with the given parameters |
Method Summary | |
double |
area()
Approximates the area of the ellipse. |
java.lang.Object |
clone()
Copies the ellipse. |
boolean |
contains(Pnt point)
Tests to see if the point is within this ellipse. |
boolean |
equals(java.lang.Object o)
Tests to see the two objects are equal. |
BoundingBox |
getBoundingBox()
Gets the bounding box around the ellipse |
Pnt |
getCentroid()
Gets a copy of the centroid. |
Rational |
getHeight()
Gets the height of the ellipse |
int |
getRotation()
|
Rational |
getWidth()
Gets the width of the ellipse |
Rational |
getX()
Gets the x-coordinate of the origin |
Rational |
getY()
Gets the y-coordinate of the origin |
double |
intersectArea(Ellipse other)
Computes the area shared between the two ellipses |
Moveable |
move(int direction,
int distance)
Creates a new copy of this movable item, shifted in the given direction by the given number of pixels. |
Moveable |
shift(int x,
int y)
Shifts the moveable by the given amount. |
java.lang.String |
toString()
Prints out the circle in the ViPER format. |
static Ellipse |
valueOf(java.lang.String S)
Constructs a new ellipse from the given string |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Ellipse()
public Ellipse(int x, int y, int width, int height, int rotation)
x
- the x-coordinate of the ellipse's bounding box's originy
- the y-coordinate of the ellipse's bounding box's originwidth
- the width of the ellipseheight
- the height of the ellipserotation
- public Ellipse(Ellipse old)
old
- the ellipse to copyMethod Detail |
public boolean equals(java.lang.Object o)
o
- the ellipse to check against
true
iff o is an Ellipse that represents
the same shapepublic static Ellipse valueOf(java.lang.String S)
S
- the string to parse - a space delimited list of four integers
BadAttributeDataException
public java.lang.String toString()
public java.lang.Object clone()
public boolean contains(Pnt point)
point
- the point to test for
public BoundingBox getBoundingBox()
public double area()
public double intersectArea(Ellipse other)
other
- the area to intersect with
public Rational getX()
public Rational getY()
public Rational getWidth()
public Rational getHeight()
public int getRotation()
public Pnt getCentroid()
HasCentroid
getCentroid
in interface HasCentroid
HasCentroid.getCentroid()
public Moveable move(int direction, int distance)
Moveable
move
in interface Moveable
direction
- the direction to move the itemdistance
- the distance to move it
Moveable.move(int, int)
public Moveable shift(int x, int y)
Moveable
shift
in interface Moveable
x
- y
-
Moveable.shift(int, int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |