code: function(imageX, imageY, current) {
          if (imageX instanceof $.Point) {
              //they passed a point instead of individual components
              current = imageY;
              imageY = imageX.y;
              imageX = imageX.x;
          }
  
          var point = this._imageToViewportDelta(imageX, imageY);
          if (current) {
              point.x += this._xSpring.current.value;
              point.y += this._ySpring.current.value;
          } else {
              point.x += this._xSpring.target.value;
              point.y += this._ySpring.target.value;
          }
  
          return point.rotate(this.getRotation(current), this._getRotationPoint(current));
      }
docs: Translates from image coordinate system to OpenSeadragon viewer coordinate system
  This method can be called either by passing X,Y coordinates or an {@link OpenSeadragon.Point}.
  @param {Number|OpenSeadragon.Point} imageX - The X coordinate or point in image coordinate system.
  @param {Number} [imageY] - The Y coordinate in image coordinate system.
  @param {Boolean} [current=false] - Pass true to use the current location; false for target location.
  @return {OpenSeadragon.Point} A point representing the coordinates in the viewport.