The Innards of a Rotation Function
问题 I'm looking for information on what goes on in a rotation function that modifies a 2d matrix. I found this, but assigning the rotation to 90, 180, or 270 renders no change. Here's my code: Matrix.prototype.rotate = function(deg) { var radians = deg * Math.PI / 180, sin = Math.sin(radians), cos = Math.cos(radians), a = this.a, b = this.b, c = this.c, d = this.d, tx = this.tx, ty = this.ty; this.a = a*cos - b*sin; this.b = a*sin + b*cos; this.c = c*cos - d*sin; this.d = c*sin + d*cos; this.tx =