Hi guys! I’m having some problems understanding the logic behind this code:
var angle = 0;
var radius = 100;
onEnterFrame = function() {
mc._x = Math.cos(angle) * radius;
mc._y = Math.sin(angle) * radius;
angle += .1;
}
As you can see this code makes “mc clip” to rotate with a radius of 100. I understand how sine waves works, but i can’t figured out how mixing Math.cos() and Math.sin() makes a circular movement (whats the foundation behind that?)
Time ago I found a tutorial about this subject here in Kirupa, unfortunately I’ve lost the URL.
Please, any explanation will be very useful. Thank you.