Initial commit.
This commit is contained in:
66
src/main/java/fr/insa/gei/angles/IAngleFactory.java
Normal file
66
src/main/java/fr/insa/gei/angles/IAngleFactory.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package fr.insa.gei.angles;
|
||||
|
||||
public interface IAngleFactory<Angle extends IAngle> {
|
||||
|
||||
/**
|
||||
* Construct a new Angle object using the given value in radians.
|
||||
*
|
||||
* @param radians Value of the angle in radians.
|
||||
* @return a new Angle object.
|
||||
*/
|
||||
public Angle fromRadians(double radians);
|
||||
|
||||
/**
|
||||
* Construct a new Angle object using the given value in degrees.
|
||||
*
|
||||
* @param degrees Value of the angle in degrees.
|
||||
* @return a new Angle object.
|
||||
*/
|
||||
public Angle fromDegrees(double degrees);
|
||||
|
||||
/**
|
||||
* Construct a new Angle object corresponding to the arc cosine of the given
|
||||
* value.
|
||||
*
|
||||
* @param a Value for which to compute the arc cosine.
|
||||
* @return a new Angle object.
|
||||
*/
|
||||
public default Angle acos(double a) {
|
||||
return fromRadians(Math.acos(a));
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Angle object corresponding to the arc sine of the given
|
||||
* value.
|
||||
*
|
||||
* @param a Value for which to compute the arc sine.
|
||||
* @return a new Angle object.
|
||||
*/
|
||||
public default Angle asin(double a) {
|
||||
return fromRadians(Math.asin(a));
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Angle object corresponding to the arc tangent of the given
|
||||
* value.
|
||||
*
|
||||
* @param a Value for which to compute the arc tangent.
|
||||
* @return a new Angle object.
|
||||
*/
|
||||
public default Angle atan(double a) {
|
||||
return fromRadians(Math.atan(a));
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Angle object corresponding to the arc tangent of the given
|
||||
* values.
|
||||
*
|
||||
* @param y Value for which to compute the arc tangent.
|
||||
* @param x Value for which to compute the arc tangent.
|
||||
* @return a new Angle object.
|
||||
*/
|
||||
public default Angle atan2(double y, double x) {
|
||||
return fromRadians(Math.atan2(y, x));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user