code: function(origin, angle) {
  
              origin = origin || new g.Point(0, 0);
  
              angle = toRad(normalizeAngle(-angle));
              var cosAngle = cos(angle);
              var sinAngle = sin(angle);
  
              var x = (cosAngle * (this.x - origin.x)) - (sinAngle * (this.y - origin.y)) + origin.x;
              var y = (sinAngle * (this.x - origin.x)) + (cosAngle * (this.y - origin.y)) + origin.y;
  
              this.x = x;
              this.y = y;
              return this;
          }
docs: Rotate point by angle around origin. Angle is flipped because this is a left-handed coord system (y-axis points downward).