code: def _arcball(x, y, w, h):
      """Convert x,y coordinates to w,x,y,z Quaternion parameters
  
      Adapted from:
  
      linalg library
  
      Copyright (c) 2010-2015, Renaud Blanch <rndblnch at gmail dot com>
      Licence at your convenience:
      GPLv3 or higher <http://www.gnu.org/licenses/gpl.html>
      BSD new <http://opensource.org/licenses/BSD-3-Clause>
      """
      r = (w + h) / 2.0
      x, y = -(2.0 * x - w) / r, -(2.0 * y - h) / r
      h = np.sqrt(x * x + y * y)
      return (
          (0.0, x / h, y / h, 0.0)
          if h > 1.0
          else (0.0, x, y, np.sqrt(1.0 - h * h))
      )
  
file_path: vispy/examples/basics/visuals/arcball.py
imports: import sys
  import numpy
  from vispy import app
  from vispy.visuals import BoxVisual, transforms
  from vispy.util.quaternion import Quaternion
label_desc: Use image node_id 1 for calling a global function with example usage: _arcball(x, y, w, h) and returns: unknown