From 0e1c9c901d5f69d162814f71e1d62169f018c95b Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 24 Jan 2007 19:22:53 +0000 Subject: [PATCH] + cot, sec, csc, secant, cosecant (mantis #8142) git-svn-id: trunk@6170 - --- rtl/objpas/math.pp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/rtl/objpas/math.pp b/rtl/objpas/math.pp index 5c7bc0828a..535fddca5b 100644 --- a/rtl/objpas/math.pp +++ b/rtl/objpas/math.pp @@ -262,8 +262,14 @@ function radtocycle(rad : float) : float; function tan(x : float) : float; function cotan(x : float) : float; +function cot(x : float) : float; inline; procedure sincos(theta : float;out sinus,cosinus : float); +function secant(x : float) : float; inline; +function cosecant(x : float) : float; inline; +function sec(x : float) : float; inline; +function csc(x : float) : float; inline; + { inverse functions } function arccos(x : float) : float; @@ -677,6 +683,11 @@ function cotan(x : float) : float; end; {$endif FPC_MATH_HAS_COTAN} +function cot(x : float) : float; inline; +begin + cot := cotan(x); +end; + {$ifndef FPC_MATH_HAS_SINCOS} procedure sincos(theta : float;out sinus,cosinus : float); @@ -687,6 +698,30 @@ procedure sincos(theta : float;out sinus,cosinus : float); {$endif FPC_MATH_HAS_SINCOS} +function secant(x : float) : float; inline; +begin + secant := 1 / cos(x); +end; + + +function cosecant(x : float) : float; inline; +begin + cosecant := 1 / sin(x); +end; + + +function sec(x : float) : float; inline; +begin + sec := secant(x); +end; + + +function csc(x : float) : float; inline; +begin + csc := cosecant(x); +end; + + { ArcSin and ArcCos from Arjan van Dijk (arjan.vanDijk@User.METAIR.WAU.NL) }