JavaScript Math.sin and Math.cos return wrong values -


i'm developing simple application math teacher teach trigonometry. application nothing circle angle keeps spinning , shows variation of sin , cos. simple hell.

this have far:

enter image description here

and want achieve

enter image description here

(notice green part representing cos).

everything being built through css. needed calculate height , width of green triangle display it, tought simple calculating sin , cos , multiplying 200(my circle radius in px). reason js giving me inaccurate values sin , cos. example, gives right values if angle 0(cos: 1, sen: 0). if use angle 90, not return right values, shows screenshot below:

enter image description here

this code far(reduced readability)

function trig() {     [...]     this.radianmultiplier = math.pi / 180;      this.setdegree = function(degree)     {         [...]          $('#h').html( math.sin(degree * this.radianmultiplier) );         $('#w').html( math.cos(degree * this.radianmultiplier) );     } } 

any thoughts on might happening?


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -