2nd attempt at post with corrected code
- To: mathgroup at smc.vnet.net
- Subject: [mg69274] 2nd attempt at post with corrected code
- From: "T Harris" <tdh1967 at bellsouth.net>
- Date: Tue, 5 Sep 2006 05:30:36 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello,
I have tried everything I know to get this code to look as it does in the
notebook. I can't do it. However, once it is copied and pasted in a
notebook, it works on my machine and looks like it originally did. If it
doesn't work for anyone else, thanks for the try. I can't remove my last
message. This is my second attempt at this. I am sorry others have tried
and been unable to help because of missing code. If it doesn't work now,
thanks, and I won't try again to repost this. There should be three parts
to the code. If there is any type of error, please forget about it.
Thanks.
The two questions I had were (1) How do I find the planar area of the
ellipsoid? and (2) How do I identify what plane it plots out on?
In[1222]:=
\!\(\(Clear[perpframe, r];\)\n
\(r = Random[Real, {\[Pi]\/4, \[Pi]\/2}];\)\n
\(s = Random[Real, {0, \[Pi]\/2}];\)\n
\(\(t = Random[Real, {\(-\(\[Pi]\/2\)\), \[Pi]\/2}];\)\(\n\)
\)\n
\(Clear[perpframe];\)\n
\(\({perpframe[1], perpframe[2],
perpframe[3]} = {{Cos[r]\ Cos[t] - Cos[s]\ Sin[r]\ Sin[t],
Cos[t]\ Sin[r] + Cos[r]\ Cos[s]\ Sin[t],
Sin[s]\ Sin[t]}, {\(-Cos[s]\)\ Cos[t]\ Sin[r] - Cos[r]\ Sin[t],
Cos[r]\ Cos[s]\ Cos[t] - Sin[r]\ Sin[t],
Cos[t]\ Sin[s]}, {Sin[r]\ Sin[s], \(-Cos[r]\)\ Sin[s],
Cos[s]}};\)\(\n\)
\)\n
\(ranger = 1.0;\)\n
\(frameplot =
Show[Table[
Arrow[perpframe[k], Tail \[Rule] {0, 0, 0},
VectorColor \[Rule] Indigo], {k, 1, 3}],
Graphics3D[Text["\<perpframe[1]\>", 0.5\ perpframe[1]]],
Graphics3D[Text["\<perpframe[2]\>", 0.5\ perpframe[2]]],
Graphics3D[
Text["\<perpframe[3]\>",
0.5\ perpframe[3]]], \[IndentingNewLine]Axes3D[ranger],
PlotRange \[Rule] {{\(-ranger\), ranger}, {\(-ranger\),
ranger}, {\(-ranger\), ranger}}, Boxed \[Rule] False,
Axes \[Rule] True, ViewPoint \[Rule] CMView,
AxesLabel \[Rule] {"\<x\>", "\<y\>", "\<z\>"}];\)\)
In[1230]:=
{xstretch,ystretch,zstretch} = {1.5,0.8,0};
ranger=1.5;
{slow,shigh} = {0,Pi};
{tlow,thigh} = {0,2 Pi};
hungellipsoidplot =
ParametricPlot3D[ xstretch Sin[s] Cos[t] perpframe[1] +
ystretch Sin[s] Sin[t] perpframe[2] +
zstretch Cos[s]perpframe[3], {s,slow,shigh},{t,tlow,
thigh},
PlotRange->{{-ranger,ranger},{-ranger,ranger},{-ranger,ranger}},
Axes->True,AxesLabel->{"x","y","z"},
Boxed->False,ViewPoint->CMView,DisplayFunction->Identity];
setup =Show[hungellipsoidplot,frameplot,Axes3D[ranger],
DisplayFunction->$DisplayFunction];
In[1236]:=
Show[setup,ViewPoint->12 perpframe[1]];