# Math Functions (trigonometry)

this here is a whole bunch of math functions! Too many for me to list right here so come in and check em' all out

### Code

`Public Function InvSin(Number As Double) As Double InvSin = CutDecimal(Atn(Number / Sqr(-Number * Number + 1)), 87)End FunctionPublic Function InvCos(Number As Double) As Double InvCos = Atn(-Number / Sqr(-Number * Number + 1)) + 2 * Atn(1)End FunctionPublic Function InvSec(Number As Double) As Double InvSec = Atn(Number / Sqr(Number * Number - 1)) + Sgn((Number) - 1) * (2 * Atn(1))End FunctionPublic Function InvCsc(Number As Double) As Double InvCsc = Atn(Number / Sqr(Number * Number - 1)) + (Sgn(Number) - 1) * (2 * Atn(1))End FunctionPublic Function InvCot(Number As Double) As Double InvCot = Atn(Number) + 2 * Atn(1)End FunctionPublic Function Sec(Number As Double) As Double Sec = 1 / Cos(Number * PI / 180)End FunctionPublic Function Csc(Number As Double) As Double Csc = 1 / Sin(Number * PI / 180)End FunctionPublic Function Cot(Number As Double) As Double Cot = 1 / Tan(Number * PI / 180)End FunctionPublic Function HSin(Number As Double) As Double HSin = (Exp(Number) - Exp(-Number)) / 2End FunctionPublic Function HCos(Number As Double) As Double HCos = (Exp(Number) + Exp(-Number)) / 2End FunctionPublic Function HTan(Number As Double) As Double HTan = (Exp(Number) - Exp(-Number)) / (Exp(Number) + Exp(-Number))End FunctionPublic Function HSec(Number As Double) As Double HSec = 2 / (Exp(Number) + Exp(-Number))End FunctionPublic Function HCsc(Number As Double) As Double HCsc = 2 / (Exp(Number) + Exp(-Number))End FunctionPublic Function HCot(Number As Double) As Double HCot = (Exp(Number) + Exp(-Number)) / (Exp(Number) - Exp(-Number))End FunctionPublic Function InvHSin() InvHSin = Log(Number + Sqr(Number * Number + 1))End FunctionPublic Function InvHCos(Number As Double) As Double InvHCos = Log(Number + Sqr(Number * Number - 1))End FunctionPublic Function InvHTan(Number As Double) As Double InvHTan = Log((1 + Number) / (1 - Number)) / 2End FunctionPublic Function InvHSec(Number As Double) As Double InvHSec = Log((Sqr(-Number * Number + 1) + 1) / Number)End FunctionPublic Function InvHCsc(Number As Double) As Double InvHCsc = Log((Sgn(Number) * Sqr(Number * Number + 1) + 1) / Number)End FunctionPublic Function InvHCot(Number As Double) As Double InvHCot = Log((Number + 1) / (Number - 1)) / 2End FunctionPublic Function Percent(is_ As Double, of As Double) As Double Percent = is_ / of * 100End Function`

Posted: 2002-06-01
By: ArchiveBot
Viewed: 104 times

Categories

Visual Basic 6

Attachments

No attachments for this post