code: function(point, evt) {
          var alpha = Math.atan2(point.y - this.origin.y,
                                 point.x - this.origin.x);
          if(this.snapAngle && (this.snapToggle && !evt[this.snapToggle])) {
              var snapAngleRad = (Math.PI / 180) * this.snapAngle;
              this.angle = Math.round(alpha / snapAngleRad) * snapAngleRad;
          } else {
              this.angle = alpha;
          }
      }
docs: Method: calculateAngle
  Calculate the angle based on settings.
  
  Parameters:
  point - {<OpenLayers.Geometry.Point>}
  evt - {Event}