public class PolarPoint
extends java.lang.Object
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
static PolarPoint |
cartesianToPolar(double x,
double y)
Returns the result of converting
(x, y) to polar coordinates. |
static PolarPoint |
cartesianToPolar(java.awt.geom.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 java.awt.geom.Point2D |
polarToCartesian(double theta,
double radius)
Returns the result of converting
(theta, radius) to Cartesian coordinates. |
static java.awt.geom.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 . |
java.lang.String |
toString() |
public PolarPoint()
public PolarPoint(double theta, double radius)
radius
and angle theta
.public double getTheta()
public double getRadius()
public void setTheta(double theta)
theta
.public void setRadius(double radius)
theta
.public static java.awt.geom.Point2D polarToCartesian(PolarPoint polar)
polar
to Cartesian coordinates.public static java.awt.geom.Point2D polarToCartesian(double theta, double radius)
(theta, radius)
to Cartesian coordinates.public static PolarPoint cartesianToPolar(java.awt.geom.Point2D point)
point
to polar coordinates.public static PolarPoint cartesianToPolar(double x, double y)
(x, y)
to polar coordinates.public java.lang.String toString()
toString
in class java.lang.Object
public void setLocation(PolarPoint p)
p
.Copyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence