  We determine the automorphism group for a large class of affine quadric
hypersurfaces over a field, viewed as affine algebraic varieties. In
particular, we find that the group of real polynomial automorphisms of the
n-sphere is just the orthogonal group O(n+1) whenever n is a power of 2. It is
not known whether the same is true for arbitrary n.
  The proof uses Karpenko's theorem that certain projective quadrics over a
field are not ruled. That is, they are not birational over the given field to
the product of any variety with the projective line. We also formulate a
general result on automorphisms of affine varieties. We conclude by
conjecturing a converse to Karpenko's theorem, predicting exactly which
projective quadrics are ruled.
