public final class AngleTools extends Object
This class provides static methods for angles :
- angles computation,
- comparison,
- arithmetic and trigonometric operations.
- In order to compute the angle between two vectors :
double angle = AngleTools.getAngleBewteen2Vector3D(vector1, vector2);
- To compute the angle 2PI modulo in the given interval : (can throw a MathIllegalArgumentException)
double res = AngleTools.angleInInterval(angle, angleInterval);
- To compare two angles in a given interval : (can throw a MathIllegalArgumentException)
boolean isEqual = AngleTools.equal(angle1, angle2, angleInterval);
- To compute the complementary angle in a given interval : (can throw a MathIllegalArgumentException)
double res = AngleTools.complementaryAngle(angle, angleInterval);
See DV-MATHS_60, 70, 80, 90, 100 .Modifier and Type | Method and Description |
---|---|
static double |
angleInInterval(double angle,
AngleInterval interval)
Computes the angle in the given interval modulo 2pi.
|
static double |
complementaryAngle(double angle,
AngleInterval interval)
Computes the complementary (PI/2 - angle) of the input angle, and then tries to express it in the
input interval.
|
static boolean |
equal(double alpha,
double beta,
AngleInterval interval)
Tests the equality of two angles after expressing them in the same interval.
|
static double |
getAngleBewteen2Vector3D(Vector3D vector1,
Vector3D vector2)
Computes the angle between 2 vectors 3D.
|
static double |
getAngleFromCosineAndSine(double cos,
double sin)
Computes an angle from the sine and the cosine
|
static double |
getOrientedAngleBetween2Vector2D(Vector2D vector1,
Vector2D vector2)
Computes the oriented angle between 2 vectors 2D.
|
static double |
getOrientedAngleBewteen2Vector3D(Vector3D vector1,
Vector3D vector2,
Vector3D vector3)
Computes the oriented angle between 2 vectors 3D.
|
static boolean |
greaterOrEqual(double alpha,
double beta,
AngleInterval interval)
Tests if one angle is greater or equal to another after expressing them in the same interval.
|
static boolean |
greaterStrict(double alpha,
double beta,
AngleInterval interval)
Tests if one angle is strictly greater than another after expressing them in the same interval.
|
static boolean |
lowerOrEqual(double alpha,
double beta,
AngleInterval interval)
Tests if one angle is lower or equal to another after expressing them in the same interval.
|
static boolean |
lowerStrict(double alpha,
double beta,
AngleInterval interval)
Tests if one angle is strictly lower than another after expressing them in the same interval.
|
static double |
oppositeAngle(double angle,
AngleInterval interval)
Computes the opposite of the input angle, and then tries to express it in the input interval.
|
static double |
supplementaryAngle(double angle,
AngleInterval interval)
Computes the supplementary (PI - angle) of the input angle, and then tries to express it in the
input interval.
|
public static double getAngleBewteen2Vector3D(Vector3D vector1, Vector3D vector2)
Vector3D
.vector1
- the first vectorvector2
- the second vector0
and PI
.
See DV-MATHS_100Vector3D.angle(Vector3D, Vector3D)
public static double getOrientedAngleBetween2Vector2D(Vector2D vector1, Vector2D vector2)
vector1
- the first vectorvector2
- the second vector-2 PI
and 2 PI
.
See DV-MATHS_100 .MathIllegalArgumentException
- if at least one norm is zeroMathIllegalArgumentException
- if at least one norm is infinitypublic static double getOrientedAngleBewteen2Vector3D(Vector3D vector1, Vector3D vector2, Vector3D vector3)
vector1
- the first vectorvector2
- the second vectorvector3
- the third vector which defines the orientation-PI
and PI
.
See DV-MATHS_100 .IllegalArgumentException
- if the cross product is wrongpublic static double getAngleFromCosineAndSine(double cos, double sin)
cos
- : the cosine of the angle we want to know the valuesin
- : the sine of the angle we want to know the value-PI
and PI
See DV-MATHS_100 .public static double angleInInterval(double angle, AngleInterval interval)
angle
- angle to be expressed inside the given intervalinterval
- interval of expressionMathIllegalArgumentException
- the angle is'nt in the interval modulo 2PIpublic static boolean equal(double alpha, double beta, AngleInterval interval)
alpha
- one anglebeta
- one angleinterval
- the interval to express the anglesMathIllegalArgumentException
- if one angle is'nt in the interval, modulo 2PIpublic static boolean lowerOrEqual(double alpha, double beta, AngleInterval interval)
alpha
- one anglebeta
- one angleinterval
- the interval to express the anglesMathIllegalArgumentException
- if one angle is'nt in the interval, modulo 2PIpublic static boolean lowerStrict(double alpha, double beta, AngleInterval interval)
alpha
- : one anglebeta
- : one angleinterval
- the interval to express the anglesMathIllegalArgumentException
- if one angle is'nt in the interval, modulo 2PIpublic static boolean greaterOrEqual(double alpha, double beta, AngleInterval interval)
alpha
- : one anglebeta
- : one angleinterval
- the interval to express the anglesMathIllegalArgumentException
- if one angle is'nt in the interval, modulo 2PIpublic static boolean greaterStrict(double alpha, double beta, AngleInterval interval)
alpha
- : one anglebeta
- : one angleinterval
- the interval to express the anglesMathIllegalArgumentException
- if one angle is'nt in the interval, modulo 2PIpublic static double supplementaryAngle(double angle, AngleInterval interval)
angle
- the angle to get the supplementaryinterval
- the interval to express the resultMathIllegalArgumentException
- if the resulting angle is'nt in the interval, modulo 2PI
See DV-MATHS_80 .public static double complementaryAngle(double angle, AngleInterval interval)
angle
- the angle to get the complementaryinterval
- the interval to express the resultMathIllegalArgumentException
- if the resulting angle is'nt in the interval, modulo 2PI
See DV-MATHS_80 .public static double oppositeAngle(double angle, AngleInterval interval)
angle
- the angle to get the complementaryinterval
- the interval to express the resultMathIllegalArgumentException
- if the resulting angle is'nt in the interval, modulo 2PI
See DV-MATHS_80 .Copyright © 2019 CNES. All rights reserved.