I Hate Maths
Blitz3D Forums/Blitz3D Beginners Area/I Hate Maths
| ||
How do I solve a triangle? I have the hypot line length, the 90 degree and the opposite angle of 32 degrees. From this I can work out the other angle:- 180-90-32=58 but how do I get the lengths of the other sides? Luna |
| ||
ni NL we have the SOS CASTOA rule (based on a picture of a sinking ship called 'castoa') the S C and T refer to sin, cos, and tan .. Anyone knows how to translate this rule to english ? :) 1 ______ 2 | ,' |.' 3 can someone complete this figure? I don't remember the A's and O's anymore :) (in the form of: sin(which/which) etc.) |
| ||
sin = opposite/hypotenuse cos = adjacent/hypotenuse tan = opposite/adjacent So, for example, the angle theta being between 1 and 3, the opposite is line 2, and the adjacent line 1, and the hypotenuse line 3. |
| ||
soh cah toa Mind that from school? Always helps me out. ....../..|. ....h/...|. ...5/....|. .../.....|o ../45 deg|. ..-------'. .....a..... h=hyp o=opposite a=adjacent for side (a) you use the 'soh' 'cah' or 'toa' So use either toa or cah, because they both use the adjacent angle :) we'll use cos: cos 45= adjacent/Hyp C A H 0.707(this number is rounded)=adjacent/5 we take the 5 over to the other side, by multiplying the whole equation by 5 0.707*5=adjacent so adjacent=3.5 Then use pytharoris theorum(sp??) basically the square of the opposite and the the square of the adjacent, when added, then take the square root to find the hyp. hyp2=adjacent2+opposite2 where 2 means squared. so: opposite2=hyp2-adjacent2 opposite2=25-12.25 opposite2=12.75 opposite=sqr root of 12.75 opposite=3.57 whessssshh. Hope you followed some of that :S for your problem just take out my hyp value, and stick in your own and your own angle and follow it thru. good luck! |
| ||
What you need to know is thisadj#=Sin(ang)*hyp opp#=Tan(ang)*adj put in you angle and hyp length and that's you! or!!! try this stupid wee program, that'll work it out for you. don't put large number in it tho, or the triangle will be drawn off screen ^_^ hyp#=Input(" Enter hyp line length") ang#=Input(" Enter an Angle") ang1#=Input(" Enter another Angle (enter -1 for no angle)") adj#=Sin(ang)*hyp opp#=Tan(ang)*adj If ang1<0 Then ang1=180-90-ang Graphics 800,600 SetBuffer BackBuffer() ;Text 0,0,"adj="+adj p1x=150 p1y=400 p2x=adj*100 p2y=0 p3x=0 p3y=opp*100 Line p1x ,p1y ,p1x+p2x ,p1y-p2y Line p1x+p2x,p1y-p2y,p1x+p2x+p3x,p1y-p2y-p3y Line p1x+p2x+p3x,p1y-p2y-p3y,p1x,p1y Text p1x+(0.5*p2x),p1y+10,adj Text p1x+p2x+7,p1y-(0.5*p3y),opp Text p1x+(0.5*p2x)-15,p1y-(0.5*p3y)-15,hyp Color 100,100,100 Text p1x-20,p1y+20,ang Text p1x+p2x+20,p1y+20,"90" Text p1x+p2x+20,p1y-p3y-20,ang1 Flip WaitKey() |
| ||
Thanks people, Ross C, Thanks for the code. It is a lot easier to understand when an example is given like that. Luna |