6
$\begingroup$

To visualize an eigenvector and value calculation I tried to display the eigenvectors (scaled by the eigenvalues) as arrows in a Graphics3D plot using Manipulate. The (symmetric) matrix is a function of three variables, so I used the sliders to set the point at which I evaluated the matrix.

This worked rather nicely, but as I change the Manipulate sliders, the box size and orientation and scaling changes which kills the effectiveness of the animation attempt.

I'm looking for a Graphics3D option that would prevent this dynamic scaling of the bounding box size and orientation. ViewAngle and ViewCenter looked the most appropriate, but didn't produce the result I expected.

Any idea how to do this?

For reference (and possible experimentation), here's the notebook content for the visualization:

Clear[o, e, e1, e2, e3, standardBasis, ee, ev, arrows, \
arrowsReference,  x, y , z , p]
o := {0, 0, 0}
e1 := {1, 0, 0}
e2 := {0, 1, 0}
e3 := {0, 0, 1}
standardBasis := {e1, e2, e3}
Manipulate[
 e := {{2 y, x, x}, {x, 0, z}, {x, z, -1}} ;
 p := {x, y, z} ;
 ev = Eigenvalues[e] ;
 (*
 Taking the orthonormal eigenvectors, and scaling them by their \
eigenvalues to get a feel for their magnitude and direction.
  *)
 ee := ev Map[ Normalize, Eigenvectors[e]]  //
   N ; (* note: sneaky multiplication of lists, pairwise eigenvalue \
times eigenvector as in:
 a = {1.5, 2}
 b = {2, 3}
  a b

 which produces: {3, 6}
 *)
 arrows = Table[Arrow[{p, p + Part[ee, i]}], {i, 3}] ;
 arrowsReference =
  Table[Arrow[{p, p + Part[standardBasis, i]}], {i, 3}] ;
 Graphics3D[{Red, Arrowheads[.05], arrows, Blue, Arrow[{o, p}],
   Green, arrowsReference}, Boxed -> True, Axes -> True],
 {{x, 1}, -10, 10},
 {{y, 2}, -10, 10},
 {{z, 4}, -10, 10}]
$\endgroup$
2
  • 2
    $\begingroup$ Have you tried setting SphericalRegion -> True in Graphics3D[]? $\endgroup$ Commented Feb 8, 2012 at 3:00
  • $\begingroup$ I hadn't tried SphericalRegion, but it doesn't change things noticeably. $\endgroup$ Commented Feb 8, 2012 at 3:10

1 Answer 1

3
$\begingroup$

Have you tried setting PlotRange->10 ?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.