parameters: (point, center, radius)
return_statement: return v
docstring: Return unit sphere coordinates from window coordinates.
docstring_summary: Return unit sphere coordinates from window coordinates.
docstring_tokens: Return unit sphere coordinates from window coordinates .
function: def arcball_map_to_sphere(point, center, radius):
      """Return unit sphere coordinates from window coordinates."""
      v = numpy.array(((point[0] - center[0]) / radius,
                       (center[1] - point[1]) / radius,
                       0.0), dtype=numpy.float64)
      n = v[0]*v[0] + v[1]*v[1]
      if n > 1.0:
          v /= math.sqrt(n) # position outside of sphere
      else:
          v[2] = math.sqrt(1.0 - n)
      return v
function_tokens: def arcball_map_to_sphere ( point , center , radius ) : v = numpy . array ( ( ( point [ 0 ] - center [ 0 ] ) / radius , ( center [ 1 ] - point [ 1 ] ) / radius , 0.0 ) , dtype = numpy . float64 ) n = v [ 0 ] * v [ 0 ] + v [ 1 ] * v [ 1 ] if n > 1.0 : v /= math . sqrt ( n ) # position outside of sphere else : v [ 2 ] = math . sqrt ( 1.0 - n ) return v