I'm learning javascript right now and i'm having a bit of trouble.

It keeps giving me the wrong vector components. Am I using the cos and sine functions correctly?Code:

function components() {

var magnitude = document.getElementById("magnitude").innerHTML;

var angle = document.getElementById("angle").innerHTML;

var xComponent, yComponent;

xComponent = magnitude * Math.cos(angle);

yComponent = magnitude * Math.sin(angle);

var myString = "The X componenent is: " + xComponent + " The y Component is: " + yComponent;

alert(myString);

}

-Redseal