|
-
Jun 2nd, 2002, 05:32 PM
#1
Thread Starter
Fanatic Member
sin and cos
I need to know the opposite of sin and cos (sin-1 on calculators)
From what i understand there's no vb function for these, can
anyone give me one? so if i put:
VB Code:
print asin(sin(5)) 'this will print 5
print acos(cos(5)) 'this will also print 5
help?
Don't pay attention to this signature, it's contradictory.
-
Jun 2nd, 2002, 06:23 PM
#2
Frenzied Member
-
Jun 2nd, 2002, 08:19 PM
#3
Fanatic Member
there aren't
They are dirived as follows (from vb-help):
Inverse Sine: Arcsin(X) = Atn(X / Sqr(-X * X + 1))
Inverse Cosine: Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Jun 3rd, 2002, 11:30 AM
#4
Thread Starter
Fanatic Member
VB Code:
Private Function Arcsin(X As Double)
Arcsin = Atn(X / Sqr(- X * X + 1))
End Function
Private Function Arccos(X As Double)
Arccos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
End Function
this causes an error (incorrect prcedure call) for some reason.
any ideas?
Don't pay attention to this signature, it's contradictory.
-
Jun 3rd, 2002, 03:09 PM
#5
Fanatic Member
try deleteing the space after the first "-" sign
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Jun 3rd, 2002, 03:13 PM
#6
Thread Starter
Fanatic Member
same result
VB Code:
Print Sin(Arcsin(5))
Public Function Arcsin(X As Double)
Arcsin = Atn(X / Sqr(-X * X + 1))
End Function
creates an error, maybe im just using it wrong too, u give arcsin an angle and a measurement? or 2 measurements?
Don't pay attention to this signature, it's contradictory.
-
Jun 3rd, 2002, 03:21 PM
#7
Fanatic Member
You give arcsin a value between 0 and 1 inclusive, the output of a sin command. It will return the number of radians (pi radians=180 degrees). The number you give it is the ratio formed
from SOH-CAH-TOA
so for arcsin, you feed it the Opposite/Hypotenuse and it gives you the angle. You can't give it a number greater than one b/c by definition, in a right triangle, the hypotenuse is the longest side.
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Jun 3rd, 2002, 03:24 PM
#8
Thread Starter
Fanatic Member
oh
radians, got it, thx
my new line..
Deg(Sin(Arcsin(Rad(40))))
... works though
Don't pay attention to this signature, it's contradictory.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|