math.geom2d
Class Angle2D

Package class diagram package Angle2D
java.lang.Object
  extended by math.geom2d.Angle2D

public class Angle2D
extends Object

This class is only devoted to static computations.

Author:
dlegland

Field Summary
static double M_2PI
           
static double M_3PI_2
           
static double M_PI
           
static double M_PI_2
           
static double M_PI_4
           
 
Constructor Summary
Angle2D()
           
 
Method Summary
static boolean containsAngle(double startAngle, double endAngle, double angle)
          Tests if an angle belongs to an angular interval, defined by two limit angle, counted Counter-clockwise.
static boolean containsAngle(double startAngle, double endAngle, double angle, boolean direct)
          Tests if an angle belongs to an angular interval, defined by two limit angle, and an orientation flag.
static boolean equals(double angle1, double angle2)
          Checks whether two angles are equal.
static double formatAngle(double angle)
          Formats an angle between 0 and 2*PI.
static double getAbsoluteAngle(double x1, double y1, double x2, double y2, double x3, double y3)
          Gets the absolute angle between the ray formed by (p2, p1) and the ray formed by (p2, p3), where pi = (xi,yi), i=1,2,3.
static double getAbsoluteAngle(Point2D p1, Point2D p2, Point2D p3)
          Gets the absolute angle between the ray formed by (p2, p1) and the ray formed by (p2, p3).
static double getAngle(double x1, double y1, double x2, double y2, double x3, double y3)
          Gets the angle between the ray formed by (p2, p1) and the ray formed by (p2, p3), where pi = (xi,yi), i=1,2,3.
static double getAngle(LinearShape2D obj1, LinearShape2D obj2)
          Gets angle between two (directed) straight objects.
static double getAngle(Point2D p1, Point2D p2, Point2D p3)
          Gets the angle between the ray formed by (p2, p1) and the ray formed by (p2, p3).
static double getAngle(Vector2D vect1, Vector2D vect2)
          Gets angle between two vectors.
static double getHorizontalAngle(double x, double y)
          Returns the horizontal angle formed by the line joining the origin and the point with given coordinate.
static double getHorizontalAngle(double x1, double y1, double x2, double y2)
          Returns the horizontal angle formed by the line joining the two given points.
static double getHorizontalAngle(LinearShape2D object)
          Returns the horizontal angle formed by the line joining the two given points.
static double getHorizontalAngle(Point2D point)
          Returns the horizontal angle formed by the line joining the origin and the given point.
static double getHorizontalAngle(Point2D p1, Point2D p2)
          Returns the horizontal angle formed by the line joining the two given points.
static double getHorizontalAngle(Vector2D vect)
          Returns the horizontal angle formed by the line joining the origin and the point with given coordinate.
static double getPseudoAngle(Point2D p1, Point2D p2)
          Computes the pseudo-angle of a line joining the 2 points.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

M_PI

public static final double M_PI
See Also:
Constant Field Values

M_2PI

public static final double M_2PI
See Also:
Constant Field Values

M_PI_2

public static final double M_PI_2
See Also:
Constant Field Values

M_3PI_2

public static final double M_3PI_2
See Also:
Constant Field Values

M_PI_4

public static final double M_PI_4
See Also:
Constant Field Values
Constructor Detail

Angle2D

public Angle2D()
Method Detail

formatAngle

public static final double formatAngle(double angle)
Formats an angle between 0 and 2*PI.

Parameters:
angle - the angle before formatting
Returns:
the same angle, between 0 and 2*PI.

getHorizontalAngle

public static final double getHorizontalAngle(Point2D point)
Returns the horizontal angle formed by the line joining the origin and the given point.


getHorizontalAngle

public static final double getHorizontalAngle(double x,
                                              double y)
Returns the horizontal angle formed by the line joining the origin and the point with given coordinate.


getHorizontalAngle

public static final double getHorizontalAngle(Vector2D vect)
Returns the horizontal angle formed by the line joining the origin and the point with given coordinate.


getHorizontalAngle

public static final double getHorizontalAngle(LinearShape2D object)
Returns the horizontal angle formed by the line joining the two given points.


getHorizontalAngle

public static final double getHorizontalAngle(Point2D p1,
                                              Point2D p2)
Returns the horizontal angle formed by the line joining the two given points.


getHorizontalAngle

public static final double getHorizontalAngle(double x1,
                                              double y1,
                                              double x2,
                                              double y2)
Returns the horizontal angle formed by the line joining the two given points.


getPseudoAngle

public static final double getPseudoAngle(Point2D p1,
                                          Point2D p2)

Computes the pseudo-angle of a line joining the 2 points. The pseudo-angle has same ordering property has natural angle, but is expected to be computed faster. The result is given between 0 and 360.

Parameters:
p1 - the initial point
p2 - the final point
Returns:
the pseudo angle of line joining p1 to p2

getAngle

public static final double getAngle(LinearShape2D obj1,
                                    LinearShape2D obj2)
Gets angle between two (directed) straight objects. Result is given in radians, between 0 and 2*PI.


getAngle

public static final double getAngle(Vector2D vect1,
                                    Vector2D vect2)
Gets angle between two vectors. Result is given in radians, between 0 and 2*PI.


getAngle

public static final double getAngle(Point2D p1,
                                    Point2D p2,
                                    Point2D p3)
Gets the angle between the ray formed by (p2, p1) and the ray formed by (p2, p3). Result is given in radians, between 0 and 2*PI.


getAngle

public static final double getAngle(double x1,
                                    double y1,
                                    double x2,
                                    double y2,
                                    double x3,
                                    double y3)
Gets the angle between the ray formed by (p2, p1) and the ray formed by (p2, p3), where pi = (xi,yi), i=1,2,3. Result is given in radians, between 0 and 2*PI.


getAbsoluteAngle

public static final double getAbsoluteAngle(Point2D p1,
                                            Point2D p2,
                                            Point2D p3)
Gets the absolute angle between the ray formed by (p2, p1) and the ray formed by (p2, p3). Result is given in radians, between 0 and PI.


getAbsoluteAngle

public static final double getAbsoluteAngle(double x1,
                                            double y1,
                                            double x2,
                                            double y2,
                                            double x3,
                                            double y3)
Gets the absolute angle between the ray formed by (p2, p1) and the ray formed by (p2, p3), where pi = (xi,yi), i=1,2,3. Result is given in radians, between 0 and PI.


equals

public static final boolean equals(double angle1,
                                   double angle2)
Checks whether two angles are equal.

Parameters:
angle1 - first angle to compare
angle2 - second angle to compare
Returns:
true if the two angle are equal modulo 2*PI

containsAngle

public static final boolean containsAngle(double startAngle,
                                          double endAngle,
                                          double angle)
Tests if an angle belongs to an angular interval, defined by two limit angle, counted Counter-clockwise.

Parameters:
startAngle - the beginning of the angular domain
endAngle - the end of the angular domain
angle - the angle to test
Returns:
true if angle is between the 2 limits

containsAngle

public static final boolean containsAngle(double startAngle,
                                          double endAngle,
                                          double angle,
                                          boolean direct)
Tests if an angle belongs to an angular interval, defined by two limit angle, and an orientation flag.

Parameters:
startAngle - the beginning of the angular domain
endAngle - the end of the angular domain
angle - the angle to test
direct - is true if angular domain is oriented Counter clockwise, and false if angular domain is oriented clockwise.
Returns:
true if angle is between the 2 limits


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.