edu.uci.ics.jung.algorithms.layout
Class PolarPoint

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.layout.PolarPoint

public class PolarPoint
extends Object

allows creation of points in polar coordinates. also allows conversions between polar and cartesian coordinates.

Author:
Tom Nelson - tomnelson@dev.java.net

Constructor Summary
PolarPoint()
           
PolarPoint(double theta, double radius)
           
 
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()
           
 double getTheta()
           
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)
           
 void setRadius(double radius)
           
 void setTheta(double theta)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolarPoint

public PolarPoint()

PolarPoint

public PolarPoint(double theta,
                  double radius)
Method Detail

getTheta

public double getTheta()

getRadius

public double getRadius()

setTheta

public void setTheta(double theta)

setRadius

public void setRadius(double radius)

polarToCartesian

public static Point2D polarToCartesian(PolarPoint polar)
Returns the result of converting polar to Cartesian coordinates.


polarToCartesian

public static Point2D polarToCartesian(double theta,
                                       double radius)
Returns the result of converting (theta, radius) to Cartesian coordinates.


cartesianToPolar

public static PolarPoint cartesianToPolar(Point2D point)
Returns the result of converting point to polar coordinates.


cartesianToPolar

public static PolarPoint cartesianToPolar(double x,
                                          double y)
Returns the result of converting (x, y) to polar coordinates.


toString

public String toString()
Overrides:
toString in class Object

setLocation

public void setLocation(PolarPoint p)


Copyright © 2008 null. All Rights Reserved.