Jump to content

help with sin()


geordie_b

Recommended Posts

Hi, this is really annoying me.

 

I am trying to write a fucntion that will work out the angle of a triangle. I have the hypotenuse length value and the opposite length value.

 

when working this out on a calculator i would do

 

sin^-1(opposite/hypotenuse)

 

How do i do this using the sin() or asin() functions as everything i have tried gives me the wrong answer

 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/62342-help-with-sin/
Share on other sites

hi

 

thanks for your replies but im still getting the wrong answer. my code reads....

 

$ooverh = (113 / 2) / 180;

$sinooverh = asin($ooverh);

$answer = rad2deg($sinooverh);

 

This gives me the answer of 18.293 degrees when the correct answer from my calculator is 20.326

 

Any suggestions as to what i am doing wrong?

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/62342-help-with-sin/#findComment-310260
Share on other sites

my calculator is broken :(

 

http://www.csgnetwork.com/righttricalc.html gives the answer you guys say.

 

I have a feeling my calculator is about to be broken some more  >:(

 

EDIT - Calculator was in the wrong mode, just wasted a day trying to get php to match with a wrong answer :(

Link to comment
https://forums.phpfreaks.com/topic/62342-help-with-sin/#findComment-310307
Share on other sites

~cooldude

 

a 30 : 60 : 90 triangle would be half an equilateral triangle with sides

 

2 : 1 : sqrt(3)

well you can't have half a triangle its an abstract value because the idea of sides is a counting number there are no "half" sides, a 60:60:60 is the ideal equilateral triangle, but a triangle is just an example of the correlation between angles and lengths of the interacting sides of objects. Equilateral is just a adjective to the word that means nothing really because you can have scalar version of the same equilateral triangle that will integrate to a different area (it is a scalar of the other version area of integration) but the the same value.  The legs/base are individually equal to: (sqrt(3)/4)(t^2)  where 2 is any scalar value applied to each side.  Hope this helps clear up the misunderstanding we all have had on triangles, not that its important because its only a definition not an absolute.

Link to comment
https://forums.phpfreaks.com/topic/62342-help-with-sin/#findComment-310331
Share on other sites

Bleh.... I meant the angles...

 

You're going all mathematical on me lol....

 

I just meant if you took a triangle like:

 

    60

 

60      60

 

And drew a line perpendicular to one of the bases (or what ever you would call one of the lines from one of the 60 degree angels to another.... legs maybe?  I know it would be legs if the triangle had a hypotenuse...) you would end up with the angles:

 

    30

 

60 90

 

on one side of the line, and:

 

30

 

90 60

 

on the other side of the line.

Link to comment
https://forums.phpfreaks.com/topic/62342-help-with-sin/#findComment-310345
Share on other sites

You'd think someone "going all mathematical" would have grasp of basic trig and not claim a triangle with sides 3:4:5 had angles 30:60:90

 

Here you are, the right-hand half of an eqiulateral triangle. Nothing abstract - just draw one on a piece of card and cut it vertically up the centre.

 

[pre]

        |

        | \

        |30\

        |  \    2

  sqrt3 |    \

        |    \

        |90  60\

        |------ \

       

          1

[/pre]

Link to comment
https://forums.phpfreaks.com/topic/62342-help-with-sin/#findComment-310418
Share on other sites

You can't use the word half its so wrong on so many levels.  Half implies 50% 1/2  if 2 is whole half is 1.  Half can't be applied it be half equal?  it be half size? it be half angles? (yes there is a half angle formula but its irrelevant)  It can't be half of anything its simply a triangle with sides of 3-4-5 that is its definitiion no more no less everything else is a derivation of this core information actually you can call it a 3-4 triangle because the third side must be 5 that is all it needs to be defined by no more no less, however you must note that neither 3 nor 4 are the hypotenuses in this case because then you could have a sqrt(7),3,4 one

Link to comment
https://forums.phpfreaks.com/topic/62342-help-with-sin/#findComment-310443
Share on other sites

You can't use the word half its so wrong on so many levels.  Half implies 50% 1/2  if 2 is whole half is 1.  Half can't be applied it be half equal?  it be half size? it be half angles? (yes there is a half angle formula but its irrelevant)

Apparently mathematics has changed dramatically since Barand and I were in school. Either that, or a great deal was lost in translation.

Link to comment
https://forums.phpfreaks.com/topic/62342-help-with-sin/#findComment-310447
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.