Tag Archives: rotation

Drawing a Rotated Image to an HTML5 Canvas

The JavaScript code below, when run, prompts the user to specify an image file to be uploaded, and then displays that image, scaled to 100 x 100 pixels and rotated 45 degrees clockwise in the center of an HTML5 canvas.

Posted in Uncategorized | Tagged , , , , | Leave a comment

Performing Rotation with Quaternions in JavaScript

The JavaScript code below performs some rotations on a set of coordinates around a pair of axes, using quaternions to do the calculations. To see the code in action, copy it into a .html file and open that file in … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Representing Rotations as Quaternions

Quaternions are mathematical constructs that can be used to rotate a geometrical point through a particular angle around a particular axis. They avoid many of the problems associated with performing rotations using Euler angles (yaw, pitch, roll), notably the phenomenon … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment