public class PolarCoordinates
extends java.lang.Object
Constructor and Description |
---|
PolarCoordinates(double distance,
double angle,
java.awt.Point center) |
PolarCoordinates(int x,
int y,
java.awt.Point center) |
PolarCoordinates(PolarCoordinates original) |
Modifier and Type | Method and Description |
---|---|
void |
add(PolarCoordinates po2) |
double |
getAngle() |
double |
getAngleDeg() |
double |
getDistance() |
int |
getX() |
int |
getY() |
void |
mult(double scale) |
void |
setAngle(double angle)
sets the angle in radians
|
void |
setAngleDeg(double angle)
sets teh angle in degrees
|
void |
setCenter(java.awt.Point center)
does not change the x or y coordinates, but recalculates the polar coordinates
relative to the given Center.
|
void |
setDistance(double radius) |
void |
subtract(PolarCoordinates po2) |
java.lang.String |
toString() |
public PolarCoordinates(PolarCoordinates original)
public PolarCoordinates(int x, int y, java.awt.Point center)
public PolarCoordinates(double distance, double angle, java.awt.Point center)
public double getDistance()
public double getAngle()
public double getAngleDeg()
public int getX()
public int getY()
public void setCenter(java.awt.Point center)
center
- public void setDistance(double radius)
public void setAngle(double angle)
angle
- public void setAngleDeg(double angle)
angle
- public void add(PolarCoordinates po2)
public void subtract(PolarCoordinates po2)
public void mult(double scale)
public java.lang.String toString()
toString
in class java.lang.Object