Message Boards Message Boards

0
|
1439 Views
|
9 Replies
|
5 Total Likes
View groups...
Share
Share this post:

3D projection on xy and xz planes

Posted 1 year ago

I have this equation in spherical coordinates and I want to make contour on xy, xz planes

t[[Theta], [Phi]] := 1/(0.0041542 - (2 (0.0041542 + 0.0011726) - 0.0079190) ([Alpha]^2 [Beta]^2 + [Alpha]^2 [Gamma]^2 + \ [Beta]^2 [Gamma]^2));

[Alpha] = Sin[[Theta]] Cos[[Phi]]; [Beta] = Sin[[Theta]] Sin[[Phi]]; [Gamma] = Cos[[Theta]];

SphericalPlot3D[ t[[Theta], [Phi]], {[Theta], 0, Pi}, {[Phi], 0, 2 Pi}, Axes -> True, Ticks -> {{-200, -100, 0, 100, 200}, {-200, -100, 0, 100, 200}, {-200, -100, 0, 100, 200}}, LabelStyle -> {FontSize -> 12, FontFamily -> "Times", Black}, ImageSize -> {350, 350}, FaceGridsStyle -> Directive[Black, Dashed], ImagePadding -> 50, LabelStyle -> Directive[Bold, Black]]

enter image description here

POSTED BY: Tito Nono
9 Replies

In those pictures I can't see "contours", but rather arrangements of dots.

Maybe this is more similar to what you are seeking:

\[Alpha] = Sin[\[Theta]] Cos[\[Phi]]; \[Beta] = 
 Sin[\[Theta]] Sin[\[Phi]]; \[Gamma] = Cos[\[Theta]];
t[\[Theta]_, \[Phi]_] := 
  1/(0.0041542 - (2 (0.0041542 + 0.0011726) - 
        0.0079190) (\[Alpha]^2 \[Beta]^2 + \[Alpha]^2 \[Gamma]^2 + \
\[Beta]^2 \[Gamma]^2));
wireframe = 
 SphericalPlot3D[
  t[\[Theta], \[Phi]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, 
  Axes -> True, 
  Ticks -> {{-200, -100, 0, 100, 200}, {-200, -100, 0, 100, 
     200}, {-200, -100, 0, 100, 200}}, 
  LabelStyle -> {FontSize -> 12, FontFamily -> "Times", Black}, 
  ImageSize -> {350, 350}, FaceGridsStyle -> Directive[Black, Dashed],
   ImagePadding -> 50, LabelStyle -> Directive[Bold, Black], 
  PlotStyle -> None, MeshFunctions -> {#6 &}]
Graphics3D[
 Normal[wireframe[[1]]] /. 
  Line[lst_] :> 
   Line[Map[Function[xyz, {xyz[[1]], xyz[[2]], 0}], lst]]]
POSTED BY: Gianluca Gorni

You should clarify what you mean by "contour".

POSTED BY: Gianluca Gorni
Posted 1 year ago

Thank you for valuable help How to change the origin of these plots?

\[Alpha] = Sin[\[Theta]] Cos[\[Phi]]; \[Beta] = 
 Sin[\[Theta]] Sin[\[Phi]]; \[Gamma] = Cos[\[Theta]];
t[\[Theta]_, \[Phi]_] := 
  1/(0.0041542 - (2 (0.0041542 + 0.0011726) - 
        0.0079190) (\[Alpha]^2 \[Beta]^2 + \[Alpha]^2 \[Gamma]^2 + \
\[Beta]^2 \[Gamma]^2));
wireframe = 
 SphericalPlot3D[
  t[\[Theta], \[Phi]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, 
  Axes -> True, 
  Ticks -> {{-200, -100, 0, 100, 200}, {-200, -100, 0, 100, 
     200}, {-200, -100, 0, 100, 200}}, 
  LabelStyle -> {FontSize -> 12, FontFamily -> "Times", Black}, 
  ImageSize -> {350, 350}, FaceGridsStyle -> Directive[Black, Dashed],
   ImagePadding -> 50, LabelStyle -> Directive[Bold, Black], 
  ColorFunction -> (ColorData["DarkRainbow"][#6] &), PlotStyle -> None]



p1 = Graphics3D[
  Normal[wireframe[[1]]] /. 
   Line[lst_] :> 
    Line[Map[Function[xyz, {xyz[[1]], xyz[[2]], 0}], lst]]]
p2 = Graphics3D[
  Normal[wireframe[[1]]] /. 
   Line[lst_] :> 
    Line[Map[Function[xyz, {xyz[[1]], 0, xyz[[3]]}], lst]]]
p3 = Graphics3D[
  Normal[wireframe[[1]]] /. 
   Line[lst_] :> 
    Line[Map[Function[xyz, {0, xyz[[2]], xyz[[3]]}], lst]]]


Show[p1, p2, p3, PlotRange -> All, BoxRatios -> {1, 1, 1}]

enter image description here

POSTED BY: Tito Nono
\[Alpha] = Sin[\[Theta]] Cos[\[Phi]]; \[Beta] = 
 Sin[\[Theta]] Sin[\[Phi]]; \[Gamma] = Cos[\[Theta]];
t[\[Theta]_, \[Phi]_] := 
  1/(0.0041542 - (2 (0.0041542 + 0.0011726) - 
        0.0079190) (\[Alpha]^2 \[Beta]^2 + \[Alpha]^2 \[Gamma]^2 + \
\[Beta]^2 \[Gamma]^2));
wireframe = 
  SphericalPlot3D[
   t[\[Theta], \[Phi]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, 
   Axes -> True, 
   Ticks -> {{-200, -100, 0, 100, 200}, {-200, -100, 0, 100, 
      200}, {-200, -100, 0, 100, 200}}, 
   LabelStyle -> {FontSize -> 12, FontFamily -> "Times", Black}, 
   ImageSize -> {350, 350}, 
   FaceGridsStyle -> Directive[Black, Dashed], ImagePadding -> 50, 
   LabelStyle -> Directive[Bold, Black], PlotStyle -> None, 
   MeshFunctions -> {#6 &}];
p1 = Normal[wireframe[[1]]] /. 
   Line[lst_] :> 
    Line[Map[Function[xyz, {xyz[[1]], xyz[[2]], -300}], lst]];
p2 = Normal[wireframe[[1]]] /. 
  Line[lst_] :> 
   Line[Map[Function[xyz, {xyz[[1]], 300, xyz[[3]]}], lst]]
p3 = Normal[wireframe[[1]]] /. 
   Line[lst_] :> 
    Line[Map[Function[xyz, {-300, xyz[[2]], xyz[[3]]}], lst]];
Graphics3D[{p1, p2, p3}]
POSTED BY: Gianluca Gorni
Posted 1 year ago

Thank you Gianluca Gorni! Thank you! Thank you!

POSTED BY: Tito Nono
Posted 1 year ago

Hi, Is it possible to fill the projected areas with color.

POSTED BY: Tito Nono

Here is a first attempt:

\[Alpha] = Sin[\[Theta]] Cos[\[Phi]]; \[Beta] = 
 Sin[\[Theta]] Sin[\[Phi]]; \[Gamma] = Cos[\[Theta]];
t[\[Theta]_, \[Phi]_] := 
  1/(0.0041542 - (2 (0.0041542 + 0.0011726) - 
        0.0079190) (\[Alpha]^2 \[Beta]^2 + \[Alpha]^2 \[Gamma]^2 + \
\[Beta]^2 \[Gamma]^2));
wireframe = 
  SphericalPlot3D[
   t[\[Theta], \[Phi]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, 
   Axes -> True, 
   Ticks -> {{-200, -100, 0, 100, 200}, {-200, -100, 0, 100, 
      200}, {-200, -100, 0, 100, 200}}, 
   LabelStyle -> {FontSize -> 12, FontFamily -> "Times", Black}, 
   ImageSize -> {350, 350}, 
   FaceGridsStyle -> Directive[Black, Dashed], ImagePadding -> 50, 
   LabelStyle -> Directive[Bold, Black], PlotStyle -> None, 
   MeshFunctions -> {#6 &}, PlotPoints -> 50];
p1 = Normal[wireframe[[1]]] /. 
   Line[lst_] :> 
    Line[Map[Function[xyz, {xyz[[1]], xyz[[2]], -300}], lst]];
p2 = Normal[wireframe[[1]]] /. 
  Line[lst_] :> 
   Line[Map[Function[xyz, {xyz[[1]], 300, xyz[[3]]}], lst]]
p3 = Normal[wireframe[[1]]] /. 
   Line[lst_] :> 
    Line[Map[Function[xyz, {-300, xyz[[2]], xyz[[3]]}], lst]];
Graphics3D[{p1, {Green, Cases[p1, Line[pts_] :> Polygon[pts], All]}, 
  p2, p3}]
POSTED BY: Gianluca Gorni

Do you mean you want to project the contours onto the planes? Here is a way:

\[Alpha] = Sin[\[Theta]] Cos[\[Phi]]; \[Beta] = 
 Sin[\[Theta]] Sin[\[Phi]]; \[Gamma] = Cos[\[Theta]];
t[\[Theta]_, \[Phi]_] := 
  1/(0.0041542 - (2 (0.0041542 + 0.0011726) - 
        0.0079190) (\[Alpha]^2 \[Beta]^2 + \[Alpha]^2 \[Gamma]^2 +  \
\[Beta]^2 \[Gamma]^2));
wireframe = 
 SphericalPlot3D[
  t[\[Theta], \[Phi]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, 
  Axes -> True, 
  Ticks -> {{-200, -100, 0, 100, 200}, {-200, -100, 0, 100, 
     200}, {-200, -100, 0, 100, 200}}, 
  LabelStyle -> {FontSize -> 12, FontFamily -> "Times", Black}, 
  ImageSize -> {350, 350}, FaceGridsStyle -> Directive[Black, Dashed],
   ImagePadding -> 50, LabelStyle -> Directive[Bold, Black], 
  PlotStyle -> None]
Graphics3D[
 Normal[wireframe[[1]]] /. 
  Line[lst_] :> 
   Line[Map[Function[xyz, {xyz[[1]], xyz[[2]], 0}], lst]]]
POSTED BY: Gianluca Gorni
Posted 1 year ago

Thank you very much Dr. Gianluca Gorni I want to keep only the projections as in the figure below.

enter image description here

POSTED BY: Tito Nono
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract