Arc Cosine

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2005
Posts: 16
Reputation: grandfilth is an unknown quantity at this point 
Solved Threads: 0
grandfilth grandfilth is offline Offline
Newbie Poster

Arc Cosine

 
0
  #1
Oct 3rd, 2005
I've looked in a couple of books, and can't find this anywhere, i'm looking for the opposite of the cos funtion, i.e. I know the cos of the angle, and need to know the actual size of the angle, is there an implicit function? If not, how can I achieve the same result? Any help would be much appreciated...
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 464
Reputation: invisal is a jewel in the rough invisal is a jewel in the rough invisal is a jewel in the rough 
Solved Threads: 49
invisal's Avatar
invisal invisal is offline Offline
Posting Pro in Training

Re: Arc Cosine

 
0
  #2
Oct 4th, 2005
try this function :

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Function ArcCos(ByVal X As Double) As Double
  2. If X <> 1 Then
  3. ArcCos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
  4. Else
  5. ArcCos = 0
  6. End If
  7. End Function
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 16
Reputation: grandfilth is an unknown quantity at this point 
Solved Threads: 0
grandfilth grandfilth is offline Offline
Newbie Poster

Re: Arc Cosine

 
0
  #3
Oct 5th, 2005
Thanks, i'll check if it works, how does it work?What's Atn?What's the theory behind it?Any help would be much appreciated, i'd like to understand you see...
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 464
Reputation: invisal is a jewel in the rough invisal is a jewel in the rough invisal is a jewel in the rough 
Solved Threads: 49
invisal's Avatar
invisal invisal is offline Offline
Posting Pro in Training

Re: Arc Cosine

 
0
  #4
Oct 5th, 2005
Atn is arctangent

let talk about math

tan(x) = sin(x) / cos(x)
cos(x) = sqr(1 - sin(x)^2)
tan(x) = sin(x) / sqr(1 - sin(x)^2)

so we got ArcSin = X / sqr(-X * X + 1)
and ArcCos = 90 - ArcSin
so ArcCos = (-X / sqr(-X * X + 1)) + 2 * Atn(1)
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 16
Reputation: grandfilth is an unknown quantity at this point 
Solved Threads: 0
grandfilth grandfilth is offline Offline
Newbie Poster

Re: Arc Cosine

 
0
  #5
Oct 5th, 2005
Thankyou very much for quenching my thirst for knowledge!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC