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
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
Share on other sites

<?php
$a = (113 / 2) / 180;
echo sin(deg2rad($a)); //0.00547836719291
?>

That gives me the same answer as my calculator... Am I doing something wrong on the calculator? I haven't done any of this stuff for like 5 years, since school...

Link to comment
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
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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.