|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.algorithms.layout.PolarPoint
public class PolarPoint
Represents a point in polar coordinates: distance and angle from the origin. Includes conversions between polar and Cartesian coordinates (Point2D).
Constructor Summary | |
---|---|
PolarPoint()
Creates a new instance with radius and angle each 0. |
|
PolarPoint(double theta,
double radius)
Creates a new instance with radius radius and angle theta . |
Method Summary | |
---|---|
static PolarPoint |
cartesianToPolar(double x,
double y)
Returns the result of converting (x, y) to polar coordinates. |
static PolarPoint |
cartesianToPolar(Point2D point)
Returns the result of converting point to polar coordinates. |
double |
getRadius()
Returns the radius for this point. |
double |
getTheta()
Returns the angle for this point. |
static Point2D |
polarToCartesian(double theta,
double radius)
Returns the result of converting (theta, radius) to Cartesian coordinates. |
static Point2D |
polarToCartesian(PolarPoint polar)
Returns the result of converting polar to Cartesian coordinates. |
void |
setLocation(PolarPoint p)
Sets the angle and radius of this point to those of p . |
void |
setRadius(double radius)
Sets the radius for this point to theta . |
void |
setTheta(double theta)
Sets the angle for this point to theta . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PolarPoint()
public PolarPoint(double theta, double radius)
radius
and angle theta
.
Method Detail |
---|
public double getTheta()
public double getRadius()
public void setTheta(double theta)
theta
.
public void setRadius(double radius)
theta
.
public static Point2D polarToCartesian(PolarPoint polar)
polar
to Cartesian coordinates.
public static Point2D polarToCartesian(double theta, double radius)
(theta, radius)
to Cartesian coordinates.
public static PolarPoint cartesianToPolar(Point2D point)
point
to polar coordinates.
public static PolarPoint cartesianToPolar(double x, double y)
(x, y)
to polar coordinates.
public String toString()
toString
in class Object
public void setLocation(PolarPoint p)
p
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |