Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
math question
#1
its not exactly related to FB except in the context that its the lang im using. Basically, i know how to get the length of the side of a right triangle given an angle and another side (sin, cos, tan) but how do i get the angle based on 2 sides? I know on my graphing calc there is a function for it (cos -1/sin -1, etc...) but i don't know of a command to do this. if there isn't a native command, is there a library I should have? Thanks
[Image: freebasic.png]
Reply
#2
I suck at math so I couldn't tell you but I saw some people talking bout a math lib for FB. You might want to see if you can find it, it might have what you are looking for.
gunder
"I have a perfect body, but it's in the trunk and starting to smell."
Reply
#3
It mostly depends on which sides you have. If you have the adjacent and hypotenuse, then you can use arccos (cos^-1), if you have adjacent and opposite, you an use arctan (tan^-1) and if you have opposite and hypotenuse then you can use arcsin (sin^-1). You probably know these because:

sin(theta) = opp/hyp
cos(theta) = adj/hyp
tan(theta) = opp/adj

[adj=adjacent, opp=opposite, hyp=hypotenuse]

EDIT: Pressed post by accident... I will continue...

You have asin, acos and atn available to you:

So, using the above formulae...

theta = asin(opp/hyp)
theta = acos(adj/hyp)
theta = atn(opp/adj)

[Edit2: fixed some inaccuracies]
img]http://www.cdsoft.co.uk/misc/shiftlynx.png[/img]
Reply
#4
ah. yes, i was looking at ATN, but it doesn't seem to work right. I do indeed have opposite and ajacent. And yes, i am converting from radians to degrees.
EDIT: Haha, silly me, i was multiplying by the conversion factor instead of dividing :oops: ok thanks Smile
[Image: freebasic.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)