DEFINITION MODULE Math1;

(* LIbrary module of trigonometric and logarithmic functions.
Author    :  John Forester
Last Edit :  4 July 87 *)

FROM MathLib0 IMPORT sqrt, sin, cos, arctan, ln, exp;

EXPORT QUALIFIED  sinr, cosr, secantr, cosecr, tanr, cotanr, 
                  arcsinr, arccosr, arctanr, 
                  sind, cosd, secantd, cosecd, tand, cotand,
                  arcsind, arccosd, arctand,
                  log, antilog;

PROCEDURE sinr(x : REAL) : REAL;
(* Returns sin(x) where x is given in radians. *)

PROCEDURE cosr(x : REAL) : REAL;
(* Returns cos(x) where x is given in radians. *)

PROCEDURE secantr(x : REAL) : REAL;
(* Returns secant(x) where x is given in radians. *)

PROCEDURE cosecr(x : REAL) : REAL;
(* Returns cosecant(x) where x is given in radians. *)

PROCEDURE tanr(x : REAL) : REAL;
(* Returns tan(x) where x is given in radians. *)

PROCEDURE cotanr(x : REAL) : REAL;
(* Returns cotan(x) where x is given in radians. *)
                   
PROCEDURE arcsinr(x : REAL)  : REAL;
(* Returns arcsin(x) in radians, but if sin it out
 of range it returns 0.0 *)

PROCEDURE arccosr(x :  REAL)  :  REAL;
(* Returns arccos(x) in radians, but if cos is out
of range it returns 0.0. *)

PROCEDURE arctanr(x  : REAL)  :  REAL;
(* Returns tan(x) where x is given in radians. *)

PROCEDURE sind(x  :  REAL)  :  REAL;
(* Returns sin(x) where x is given in degrees. *)

PROCEDURE cosd(x  :  REAL)  :  REAL;
(* Returns cos(x) where x is given in degrees. *)
               
PROCEDURE secantd(x  :  REAL)  :  REAL;
(* Returns secant(x) where x is given in degrees. *)

PROCEDURE cosecd(x  : REAL)  :  REAL;
(* Returns cosed(x) where x is given in degrees. *)

PROCEDURE tand(x : REAL) : REAL;
(* Returns tan(x) where x is given in degrees. *)

PROCEDURE cotand(x  : REAL)  : REAL;
(* Returns cotan(x) where x is given in degrees. *)

PROCEDURE arcsind(x  : REAL)  :  REAL;
(* Returns arcsin(x) in degrees, but if sin is
out of range it returns 0.0. *)

PROCEDURE arccosd(x  : REAL) : REAL;
(* Returns arccos(x) in degrees, but if cos is 
out of range it returns 0.0. *)

PROCEDURE arctand(x  :  REAL) : REAL;
(* Returns arctan(x) in degrees. *)
                  
PROCEDURE log(x : REAL) : REAL;
(* Returns log(x) in base 10, but for negative x
it returns 0.0. *)
              
PROCEDURE antilog(x : REAL) : REAL;
(* Returns antilog(x) in base 10. *)

END Math1.
