georegression.metric
Class UtilAngle
- java.lang.Object
-
- georegression.metric.UtilAngle
-
public class UtilAngle extends java.lang.ObjectUtility functions relating to angles. Unless otherwise state all angles are in radians and have a domain of -pi to pi
-
-
Constructor Summary
Constructors Constructor and Description UtilAngle()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doubleatanSafe(double y, double x)static floatatanSafe(float y, float x)static doublebound(double ang)Returns an angle which is equivalent to the one provided, but between (inclusive) -π and π.static floatbound(float ang)Returns an angle which is equivalent to the one provided, but between (inclusive) -π and π.static doubledegreeToRadian(double angleDegree)static doubledist(double angA, double angB)Returns the number of radians two angles are apart.static floatdist(float angA, float angB)Returns the number of radians two angles are apart.static doubledistanceCCW(double angA, double angB)Angular distance in radians to go from angA to angB in counter clock-wise direction.static floatdistanceCCW(float angA, float angB)Angular distance in radians to go from angA to angB in counter clock-wise direction.static doubledistanceCW(double angA, double angB)Angular distance in radians to go from angA to angB in clock-wise direction.static floatdistanceCW(float angA, float angB)Angular distance in radians to go from angA to angB in clock-wise direction.static doubledistHalf(double angA, double angB)Angular distance between two half circle angles.static doubledomain2PI(double angle)Converts an angle from -pi to pi into 0 to 2*pi domainstatic booleanisHalfDomain(double ang)Checks to see if it is between -π/2 and π/2.static booleanisStandardDomain(double ang)Checks to see if it is between -π and π.static doubleminus(double angA, double angB)Returns the difference between two angles and bounds the result between -pi and pi:
result = angA - angB
and takes in account boundary conditions.static floatminus(float angA, float angB)Returns the difference between two angles and bounds the result between -pi and pi:
result = angA - angB
and takes in account boundary conditions.static doubleradianToDegree(double angleRad)static doubletoHalfCircle(double angle)Converts an angle which is (-pi to pi) into a half circle angle (-pi/2 to pi/2).static floattoHalfCircle(float angle)Converts an angle which is (-pi to pi) into a half circle angle (0 to pi).
-
-
-
Method Detail
-
radianToDegree
public static double radianToDegree(double angleRad)
-
degreeToRadian
public static double degreeToRadian(double angleDegree)
-
atanSafe
public static double atanSafe(double y, double x)
-
atanSafe
public static float atanSafe(float y, float x)
-
toHalfCircle
public static double toHalfCircle(double angle)
Converts an angle which is (-pi to pi) into a half circle angle (-pi/2 to pi/2).- Parameters:
angle- Angle between -pi and pi.- Returns:
- -pi/2 to pi/2
-
toHalfCircle
public static float toHalfCircle(float angle)
Converts an angle which is (-pi to pi) into a half circle angle (0 to pi).- Parameters:
angle- Angle between -pi and pi.- Returns:
- 0 to pi
-
isStandardDomain
public static boolean isStandardDomain(double ang)
Checks to see if it is between -π and π.- Parameters:
ang- Angle being tested- Returns:
- true if it is between -π and π
-
isHalfDomain
public static boolean isHalfDomain(double ang)
Checks to see if it is between -π/2 and π/2.- Parameters:
ang- Angle being tested- Returns:
- true if it is between -π/2 and π/2;
-
bound
public static double bound(double ang)
Returns an angle which is equivalent to the one provided, but between (inclusive) -π and π.
-
bound
public static float bound(float ang)
Returns an angle which is equivalent to the one provided, but between (inclusive) -π and π.
-
distanceCCW
public static double distanceCCW(double angA, double angB)Angular distance in radians to go from angA to angB in counter clock-wise direction. The resulting angle will be from 0 to 2π.- Parameters:
angA- First angle. -pi to piangB- Second angle -pi to pi- Returns:
- An angle from 0 to 2 π
-
distanceCCW
public static float distanceCCW(float angA, float angB)Angular distance in radians to go from angA to angB in counter clock-wise direction. The resulting angle will be from 0 to 2π.- Parameters:
angA- First angle. -pi to piangB- Second angle -pi to pi- Returns:
- An angle from 0 to 2 π
-
distanceCW
public static double distanceCW(double angA, double angB)Angular distance in radians to go from angA to angB in clock-wise direction. The resulting angle will be from 0 to 2π.- Parameters:
angA- First angle. -pi to piangB- Second angle -pi to pi- Returns:
- An angle from 0 to 2 π
-
distanceCW
public static float distanceCW(float angA, float angB)Angular distance in radians to go from angA to angB in clock-wise direction. The resulting angle will be from 0 to 2π.- Parameters:
angA- First angle. -pi to piangB- Second angle -pi to pi- Returns:
- An angle from 0 to 2 π
-
minus
public static double minus(double angA, double angB)Returns the difference between two angles and bounds the result between -pi and pi:
result = angA - angB
and takes in account boundary conditions.- Parameters:
angA- first angle. Must be between -pi and pi.angB- second angle. Must be between -pi and pi.- Returns:
- an angle between -pi and pi
-
minus
public static float minus(float angA, float angB)Returns the difference between two angles and bounds the result between -pi and pi:
result = angA - angB
and takes in account boundary conditions.- Parameters:
angA- first angle. Must be between -pi and pi.angB- second angle. Must be between -pi and pi.- Returns:
- an angle between -pi and pi
-
dist
public static double dist(double angA, double angB)Returns the number of radians two angles are apart. This is equivalent to Math.abs(UtilAngle.minus(angA,angB)).
- Parameters:
angA- first angle. Must be between -pi and pi.angB- second angle. Must be between -pi and pi.- Returns:
- an angle between 0 and pi
-
dist
public static float dist(float angA, float angB)Returns the number of radians two angles are apart. This is equivalent to Math.abs(UtilAngle.minus(angA,angB)).
- Parameters:
angA- first angle. Must be between -pi and pi.angB- second angle. Must be between -pi and pi.- Returns:
- an angle between 0 and pi
-
distHalf
public static double distHalf(double angA, double angB)Angular distance between two half circle angles.- Parameters:
angA- Angle between -pi/2 and pi/2.angB- Angle between -pi/2 and pi/2.- Returns:
- Acute angle between the two input angles.
-
domain2PI
public static double domain2PI(double angle)
Converts an angle from -pi to pi into 0 to 2*pi domain- Parameters:
angle- angle from -pi to pi radians- Returns:
- angle from 0 to 2*pi radians
-
-
DataMelt 3.0 © DataMelt by jWork.ORG