parameters: (point, axis)
return_statement: return unit_vector([-a[1], a[0], 0.0])
docstring: Return sphere point perpendicular to axis.
docstring_summary: Return sphere point perpendicular to axis.
docstring_tokens: Return sphere point perpendicular to axis .
function: def arcball_constrain_to_axis(point, axis):
      """Return sphere point perpendicular to axis."""
      v = numpy.array(point, dtype=numpy.float64, copy=True)
      a = numpy.array(axis, dtype=numpy.float64, copy=True)
      v -= a * numpy.dot(a, v)  # on plane
      n = vector_norm(v)
      if n > _EPS:
          if v[2] < 0.0:
              numpy.negative(v, v)
          v /= n
          return v
      if a[2] == 1.0:
          return numpy.array([1.0, 0.0, 0.0])
      return unit_vector([-a[1], a[0], 0.0])
function_tokens: def arcball_constrain_to_axis ( point , axis ) : v = numpy . array ( point , dtype = numpy . float64 , copy = True ) a = numpy . array ( axis , dtype = numpy . float64 , copy = True ) v -= a * numpy . dot ( a , v ) # on plane n = vector_norm ( v ) if n > _EPS : if v [ 2 ] < 0.0 : numpy . negative ( v , v ) v /= n return v if a [ 2 ] == 1.0 : return numpy . array ( [ 1.0 , 0.0 , 0.0 ] ) return unit_vector ( [ - a [ 1 ] , a [ 0 ] , 0.0 ] )