views:

1033

answers:

2

Hello,

I want to draw an arrow using the canvas tag, javascript. I've made it using the quadratic function, but I'm having problems to calculate the angle of rotation of the arrow...

Anyone have a clue on this?

Thank you

+1  A: 

You can push your matrix, rotate it, draw your arrow and then pop the matrix.

Clint
+1  A: 

You can do:

ctx.save();
ctx.translate(xOrigin, yOrigin);
ctx.rotate(angle);
 // draw your arrow, with its origin at [0, 0]
ctx.restore();
Fabien Ménager