math - find angle from given side of right andgle triangle and vise versa in c# -


i have right angle triangle , adjutant side known me want make user enter either angle or opposite side , based on adjutant side , other entered parameter third parameter got calculated have tried given way not returning true results opposite side

oppositeside= math.tan(convert.todouble(angle) * math.pi / 180.0) * adjustantside; 

and angle have tried following way

angle = math.atan(oppositeside * adjustantside)*180/math.pi; 

but not working khow how in right way?

but not returning true results opposite side

actually does, have input angle in degrees:

double adjustantside = 0.5; int angle = 45; oppositeside= math.tan(convert.todouble(angle) * math.pi / 180.0) * adjustantside; 

output: 0.5

in unity circle (hypothenuse = length of 1) adjustantside equal oppositeside @ angle of 45°.

the tangent calculated following way:

enter image description here

taken wikipedia

so calculation should this:

angle = math.atan(oppositeside / adjustantside)*180/math.pi; 

ps. radiant conversion * math.pi / 180.0 correct: see wikipedia:

enter image description here


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -