Ok... So you have your basic Right Triangle...
Where...
Line
A is the Height (Y or Rise)
Line
B is the Length (X or Run)
Line
C is the Hypotenuse (Radius)
Angle
a is Opposite Line
A
Angle
b is Opposite Line
B
Angle
c is Opposite Line
C (and is always 90 degrees)
For the functions to work, the Triangle must be Normalized...
So, Assume the Hypotenuse (C) is 1 unit in length
And ALL angles are in Radians (Degree * Pi / 180)
----Sine and Cosine-----
Sin(a) = B / C
-so-
Sin(a) * C = B
-or-
B / Sin(a) = C
Cos(a) = A / C
-so-
Cos(a) * C = A
-or-
A / Cos(a) = C
----Tangent and Arch Tangent-----
*Note: A / B is also known as Rise over Run AKA slope
Tan(a) = A / B
-so-
Tan(a) * B = A
-or-
A / Tan(a) = B
ArcTan (ATN) is the opposite of Tan
Atn(A / B) = a
So they cancel each other out...
Tan(Atn(A / B)) = A / B
-or-
Atn(Tan(a)) = a
Other Functions can be derived from these base functions...
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
Logarithm to base N: LogN(X) = Log(X) / Log(N)
Have Fun, Be Young... Code BASIC
-Josh