View Full Version : ArcCosine Trig Function


Colin
11-28-2000, 11:57 AM
Is there a function for Arc-Cosine? I see the standard Sin & Cos, and know that VisualBasic has one (I'm trying to compute the distance between two postal codes for a LookUp function)

Richie
11-28-2000, 02:19 PM
Found this if it's any help
Function ArcCos(x As Double) As Double
' Inverse Cosine
If x = 1 Then
ArcCos = 0
ElseIf x = -1 Then
ArcCos = -PI()
Else
ArcCos = Atn(x / Sqr(-x * x + 1)) + PI() / 2
End If
End Function

Colin
11-29-2000, 08:38 AM
Actually, that is perfect. I forgot that the ArcCosine can be expressed in terms of the ArcTangent. Thank you