1.

Solve : using arccos(x) function - Visual Basic?

Answer»

hey everybody,
I have a question involving visual basic -
im creating a program that allows you to draw a TRIANGLE, and will then compute the side lengths and
angle measurements. However, i need to use inverse cosine to figure the angles out.

I know the formula for inverse cosine is
Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)

I GET the error "Invalid Call Procedure, or Argument"
and arccos(x)=empty

If any one knows how to use the function, please give me some example CODE.
Thanks alotIn order to make the ArcCos function call, you need to define the function:

Code: [Select]myVar = ArcCos(arg)

Public Function ArcCos(X As DOUBLE) As Double
ArcCos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
End Function

Hope this helps.



Discussion

No Comment Found