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:
taken wikipedia
so calculation should this:
angle = math.atan(oppositeside / adjustantside)*180/math.pi;
ps. radiant conversion * math.pi / 180.0
correct: see wikipedia:
Comments
Post a Comment