Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).

Derived Math Functions

The following non-intrinsic math functions can be derived from the intrinsic math functions:

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))
Hyperbolic Cosecant HCosec(X) = 2 / (Exp(X) - Exp(-X))
Hyperbolic Cotangent HCotan(X) = (Exp(X) + Exp(-X)) / (Exp(X) - Exp(-X))
Inverse Hyperbolic Sine HArcsin(X) = Log(X + Sqr(X * X + 1))
Inverse Hyperbolic Cosine HArccos(X) = Log(X + Sqr(X * X - 1))
Inverse Hyperbolic Tangent HArctan(X) = Log((1 + X) / (1 - X)) / 2
Inverse Hyperbolic Secant HArcsec(X) = Log((Sqr(-X * X + 1) + 1) / X)
Inverse Hyperbolic Cosecant HArccosec(X) = Log((Sgn(X) * Sqr(X * X + 1) +1) / X)
Inverse Hyperbolic Cotangent HArccotan(X) = Log((X + 1) / (X - 1)) / 2
Base-10 Logarithm Log10(X) = Log(X) / Log(10)
Logarithm to base N LogN(X) = Log(X) / Log(N)

ObjectScript Equivalents

ObjectScript supplies the following nine trigonometric functions: $ZSIN sine function; $ZCOS cosine function; $ZARCSIN inverse (arc) sine function; $ZARCCOS inverse (arc) cosine function; $ZTAN tangent function; $ZARCTAN inverse (arc) tangent function; $ZCOT cotangent function; $ZSEC secant function; and $ZCSC cosecant function.

ObjectScript supplies the following three logarithmic functions: $ZEXP e exponential function; $ZLN natural logarithm function; and $ZLOG base-10 logarithm function.

ObjectScript supplies the following two exponential functions: $ZPOWER exponent function; and $ZSQR square root function.

See Also

Feedback