package fr.insa.gei.angles; public interface IAngleFactory { /** * 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)); } }