Class PolarPoint
- java.lang.Object
-
- org.jungrapht.visualization.layout.model.PolarPoint
-
public class PolarPoint extends Object
Immutable Point. Represents a point in polar coordinates: distance and angle from the origin. Includes conversions between polar and Cartesian coordinates (Point).- Author:
- Tom Nelson
-
-
Field Summary
Fields Modifier and Type Field Description static PolarPointORIGINdoubleradiusdoubletheta
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PolarPointcartesianToPolar(double x, double y)static PolarPointcartesianToPolar(Point point)booleanequals(Object o)inthashCode()PolarPointnewRadius(double radius)static PolarPointof(double theta, double radius)static PointpolarToCartesian(double theta, double radius)static PointpolarToCartesian(PolarPoint polar)StringtoString()
-
-
-
Field Detail
-
theta
public final double theta
-
radius
public final double radius
-
ORIGIN
public static PolarPoint ORIGIN
-
-
Method Detail
-
of
public static PolarPoint of(double theta, double radius)
-
newRadius
public PolarPoint newRadius(double radius)
-
polarToCartesian
public static Point polarToCartesian(PolarPoint polar)
- Parameters:
polar- the input location to convert- Returns:
- the result of converting
polarto Cartesian coordinates.
-
polarToCartesian
public static Point polarToCartesian(double theta, double radius)
- Parameters:
theta- the angle of the input locationradius- the distance from the origin of the input location- Returns:
- the result of converting
(theta, radius)to Cartesian coordinates.
-
cartesianToPolar
public static PolarPoint cartesianToPolar(Point point)
- Parameters:
point- the input location- Returns:
- the result of converting
pointto polar coordinates.
-
cartesianToPolar
public static PolarPoint cartesianToPolar(double x, double y)
- Parameters:
x- the x coordinate of the input locationy- the y coordinate of the input location- Returns:
- the result of converting
(x, y)to polar coordinates.
-
-