4
Description Caché Basic supplies four trigonometric functions: Sin (sine), Cos (cosine), Tan (tangent), and Atn (arctangent); two logarithmic functions: Log (natural e logarithm) and Exp (e exponential); the Sqr (square root) function and the Sgn (sign) function. From these many other functions and constants can be derived. Function Derived Equivalents Secant Sec(X) = 1 / Cos(X) Cosecant Cosec(X) = 1 / Sin(X) Cotangent Cotan(X) = 1 / Tan(X) Inverse Sine Arcsin(X) = Atn(X / Sqr(-X * X + 1)) Inverse Cosine Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1) Inverse Secant Arcsec(X) = Atn(X / Sqr(X * X - 1)) + Sgn((X) -1) * (2 * Atn(1)) Inverse Cosecant Arccosec(X) = Atn(X / Sqr(X * X - 1)) + (Sgn(X) - 1) * (2 * Atn(1)) Inverse Cotangent Arccotan(X) = Atn(X) + 2 * Atn(1) Hyperbolic Sine HSin(X) = (Exp(X) - Exp(-X)) / 2 Hyperbolic Cosine HCos(X) = (Exp(X) + Exp(-X)) / 2 Hyperbolic Tangent HTan(X) = (Exp(X) - Exp(-X)) / (Exp(X) + Exp(-X)) Hyperbolic Secant HSec(X) = 2 / (Exp(X) + Exp(-X))

ATN Function

Embed Size (px)

Citation preview

DescriptionCach Basic supplies four trigonometric functions:Sin(sine),Cos(cosine),Tan(tangent), andAtn(arctangent); two logarithmic functions:Log(natural e logarithm) andExp(e exponential); theSqr(square root) function and theSgn(sign) function. From these many other functions and constants can be derived.FunctionDerived Equivalents

SecantSec(X) = 1 / Cos(X)

CosecantCosec(X) = 1 / Sin(X)

CotangentCotan(X) = 1 / Tan(X)

Inverse SineArcsin(X) = Atn(X / Sqr(-X * X + 1))

Inverse CosineArccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)

Inverse SecantArcsec(X) = Atn(X / Sqr(X * X - 1)) + Sgn((X) -1) * (2 * Atn(1))

Inverse CosecantArccosec(X) = Atn(X / Sqr(X * X - 1)) + (Sgn(X) - 1) * (2 * Atn(1))

Inverse CotangentArccotan(X) = Atn(X) + 2 * Atn(1)

Hyperbolic SineHSin(X) = (Exp(X) - Exp(-X)) / 2

Hyperbolic CosineHCos(X) = (Exp(X) + Exp(-X)) / 2

Hyperbolic TangentHTan(X) = (Exp(X) - Exp(-X)) / (Exp(X) + Exp(-X))

Hyperbolic SecantHSec(X) = 2 / (Exp(X) + Exp(-X))

Hyperbolic CosecantHCosec(X) = 2 / (Exp(X) - Exp(-X))

Hyperbolic CotangentHCotan(X) = (Exp(X) + Exp(-X)) / (Exp(X) - Exp(-X))

Inverse Hyperbolic SineHArcsin(X) = Log(X + Sqr(X * X + 1))

Inverse Hyperbolic CosineHArccos(X) = Log(X + Sqr(X * X - 1))

Inverse Hyperbolic TangentHArctan(X) = Log((1 + X) / (1 - X)) / 2

Inverse Hyperbolic SecantHArcsec(X) = Log((Sqr(-X * X + 1) + 1) / X)

Inverse Hyperbolic CosecantHArccosec(X) = Log((Sgn(X) * Sqr(X * X + 1) +1) / X)

Inverse Hyperbolic CotangentHArccotan(X) = Log((X + 1) / (X - 1)) / 2

Base-10 LogarithmLog10(X) = Log(X) / Log(10)

Logarithm to base NLogN(X) = Log(X) / Log(N)

Cach ObjectScript EquivalentsCach ObjectScript supplies the following nine trigonometric functions:$ZSINsine function;$ZCOScosine function;$ZARCSINinverse (arc) sine function;$ZARCCOSinverse (arc) cosine function;$ZTANtangent function;$ZARCTANinverse (arc) tangent function;$ZCOTcotangent function;$ZSECsecant function; and$ZCSCcosecant function.Cach ObjectScript supplies the following three logarithmic functions:$ZEXPe exponential function;$ZLNnatural logarithm function; and$ZLOGbase-10 logarithm function.Cach ObjectScript supplies the following two exponential functions:$ZPOWERexponent function; and$ZSQRsquare root function.See Also Atnfunction Cosfunction Expfunction Logfunction Sgnfunction Sinfunction Sqrfunction Tanfunction

DescriptionTheAtnfunction takes the ratio of two sides of a right triangle (number) and returns the corresponding angle in radians. The ratio is the length of the side opposite the angle divided by the length of the side adjacent to the angle. The range of the result is -pi/2 to pi/2 radians.To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi.ExamplesThe following example returns the arctangents of the integers from -4 through 4:For x = -4 TO 4Println "Arctangent of ",x," is: ",Atn(x)NextPrincipio del formularioFinal del formularioThe following example usesAtnto calculate the value of pi:Dim pipi = 4 * Atn(1) ' Calculate the value of pi.Println "pi is: ",pi