moagg.util.math
Class AngleUtil

java.lang.Object
  extended by moagg.util.math.AngleUtil

public class AngleUtil
extends java.lang.Object


Constructor Summary
AngleUtil()
           
 
Method Summary
static double getAngle(double x, double y)
          Calculates the angle relative to the origin (0/0).
static double getAngle(double x1, double y1, double x2, double y2)
          Calculates the angle between (x2/y2) and (x1/y1).
static double getAngle(Point p1, Point p2)
          Calculates the angle between p1 and p2.
static double getAngle(Rectangle r1, Rectangle r2)
          Calculates the angle between the centers of r2 and r1.
static double getAngle(Vector v1, Vector v2)
          Calculates the angle between v1 and v2.
static double normalize(double angle)
           
static int normalize(int angle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AngleUtil

public AngleUtil()
Method Detail

getAngle

public static double getAngle(double x,
                              double y)
Calculates the angle relative to the origin (0/0).


getAngle

public static double getAngle(double x1,
                              double y1,
                              double x2,
                              double y2)
Calculates the angle between (x2/y2) and (x1/y1).


getAngle

public static double getAngle(Point p1,
                              Point p2)
Calculates the angle between p1 and p2.


getAngle

public static double getAngle(Vector v1,
                              Vector v2)
Calculates the angle between v1 and v2.


getAngle

public static double getAngle(Rectangle r1,
                              Rectangle r2)
Calculates the angle between the centers of r2 and r1.


normalize

public static double normalize(double angle)

normalize

public static int normalize(int angle)


Copyright © 2008. All Rights Reserved.