1
$\begingroup$

I have this ParametricPlot3D:

enter image description here

generated by this code:

x[α_, β_, γ_, t_] :=
  Sin[α] Cos[β] Cos[γ] Cos[t] + Sin[α] Sin[γ] Sin[t] - Cos[α] Sin[β] Cos[γ];
y[α_, β_, γ_, t_] := 
  Sin[α] Cos[β] Sin[γ] Cos[t] + Sin[α] Cos[γ] Sin[t] + Cos[α] Sin[β] Sin[γ];
z[α_, β_, t_] := 
 Sin[α] Sin[β] Cos[t] + Cos[α] Cos[β]

α = π/3;
β = +π/3;
γ = 0;

Show[
  ParametricPlot3D[{Cos[u] Sin[v], Cos[u] Cos[v], Sin[u]}, {u, 0, π}, {v, -π/2, π/2},
    Mesh -> None, 
    PlotStyle -> Opacity[.25, Blue], PlotPoints -> 80, 
    MaxRecursion -> 4, 
    ExclusionsStyle -> ({Directive[Opacity[1], Thick, Red]}), 
    Boxed -> False, Axes -> False], 
  ParametricPlot3D[Normalize[{x[α, β, γ, t], y[α, β, γ, t], z[α, β, t]}], {t, 0, π}], 
  ParametricPlot3D[Normalize[{-x[α, β, γ, -t], -y[α, β, γ, -t], z[α, β, -t]}], {t, 2 π, π}],
  Graphics3D[{PointSize[0.025], Point[{0, 0, 1}]}],
  ViewPoint -> Front]

--

I want to project it down to a 2D plane so that I see something like this:

enter image description here

Any ideas?

EDIT:

The result of

Plot[Normalize[{x[α, β, γ, t], y[α, β, γ, t], z[α, β, t]}][[ ;; 2]], {t, 0, 2 π}]

is

enter image description here

EDIT 2

Trying to set $z=0$ in the parameterisation:

Show[
  ParametricPlot3D[{Cos[u] Sin[v], Cos[u] Cos[v], Sin[u]}, {u, 0, π}, {v, -π/2, π/2},
    Mesh -> None, 
    PlotStyle -> Opacity[.25, Blue], PlotPoints -> 80, 
    MaxRecursion -> 4, 
    ExclusionsStyle -> ({Directive[Opacity[1], Thick, Red]}), 
    Boxed -> False, Axes -> False], 
  ParametricPlot3D[Normalize[{x[α, β, γ, t], y[α, β, γ, t], 0}], {t, 0, π}], 
  ParametricPlot3D[Normalize[{-x[α, β, γ, -t], -y[α, β, γ, -t], 0}], {t, 2 π, π}], 
  Graphics3D[{PointSize[0.025], Point[{0, 0, 1}]}],
  ViewPoint -> Front]

enter image description here

$\endgroup$
  • $\begingroup$ You haven't included the definitions of x, y, and z, so we cannot reproduce. In principle, though, couldn't you just plot Normalize[{x[α, β, γ, t], y[α, β, γ, t], z[α, β, t]}][[;;2]]? $\endgroup$ – MarcoB Dec 17 '18 at 18:38
  • $\begingroup$ Ah, sorry. I tried yes, I included what I see. I just want it to round as it is a projection $\endgroup$ – SuperCiocia Dec 17 '18 at 18:44
  • $\begingroup$ Just set $z=0$ in your parameterization. $\endgroup$ – David G. Stork Dec 17 '18 at 18:52
  • $\begingroup$ Tried that too. See EDIT 2. $\endgroup$ – SuperCiocia Dec 17 '18 at 18:58
  • $\begingroup$ use ParametricPlot with Normalize[{x[α, β, γ, t], y[α, β, γ, t], z[α, β, t]}][[;;2]] $\endgroup$ – egwene sedai Dec 17 '18 at 19:50
4
$\begingroup$

Note that due to the use of Normalize, you may get wrong results if you just substitute z with 0. Also, the 3D plot only shows part where $z>0$, so:

Show[
  ParametricPlot[{Cos[u], Sin[u]}, {u, 0, 2 π}], 
  ParametricPlot[Most@Normalize[{x[α, β, γ, t], y[α, β, γ, t], z[α, β, t]}],
    {t, 0, π}, 
    RegionFunction -> Function[{x, y, t}, z[α, β, t] > 0]],
  ParametricPlot[Most@Normalize[{-x[α, β, γ, -t], -y[α, β, γ, -t], z[α, β, -t]}],
    {t, π, 2 π}, 
    RegionFunction -> Function[{x, y, t}, z[α, β, -t] > 0]]
 ]

enter image description here

EDIT

To put this in a 3D plot, try this idea:

p1 = Flatten[{Most[Normalize[{x[\[Alpha], \[Beta], \[Gamma], t], y[\[Alpha], \[Beta], \[Gamma], t], z[\[Alpha], \[Beta], t]}]], 0}];
p2 = Flatten[{Most[Normalize[{-x[\[Alpha], \[Beta], \[Gamma], -t], -y[\[Alpha], \[Beta], \[Gamma], -t], z[\[Alpha], \[Beta], -t]}]], 0}];
Show[ParametricPlot3D[{Cos[u], Sin[u], 0}, {u, 0, 2 \[Pi]}, 
  Axes -> False, Boxed -> False], 
 ParametricPlot3D[p1, {t, 0, \[Pi]}, 
  RegionFunction -> 
   Function[{xc, yc, zc, t}, z[\[Alpha], \[Beta], t] > 0]],
 ParametricPlot3D[p2, {t, \[Pi], 2 \[Pi]}, 
  RegionFunction -> 
   Function[{xc, yc, zc, t}, z[\[Alpha], \[Beta], -t] > 0]],
 Graphics3D[{PointSize[0.025], Point[{0, 0, 0}]}]]

enter image description here

$\endgroup$
  • $\begingroup$ Thanks. I am trying to put it in a 3D plot though so that I can change the angle of view. I tried Show[ParametricPlot3D[{Cos[u], Sin[u], 0}, {u, 0, 2 \[Pi]}, Axes -> False, Boxed -> False], ParametricPlot3D[ Most@Normalize@{x[\[Alpha], \[Beta], \[Gamma], t], y[\[Alpha], \[Beta], \[Gamma], t], z[\[Alpha], \[Beta], t]}, {t, 0, \[Pi]}, RegionFunction -> Function[{x, y, t}, z[\[Alpha], \[Beta], t] > 0]], Graphics3D[{PointSize[0.025], Point[{0, 0, 0}]}]] but it doesn't work.. any ideas? $\endgroup$ – SuperCiocia Dec 17 '18 at 23:50
  • $\begingroup$ @SuperCiocia see my edits above. $\endgroup$ – egwene sedai Dec 18 '18 at 19:35
4
$\begingroup$

Try ViewPoint -> Top instead of ViewPoint -> Front in your plot:

enter image description here

Parallel projection: ViewVector -> {{0, 0, 1000}, {0, 0, -1}}:

enter image description here

$\endgroup$
  • $\begingroup$ note due to perspective /view point, the projection obtained this way may look slightly different than what one wants. mathematica.stackexchange.com/questions/28600/… $\endgroup$ – egwene sedai Dec 17 '18 at 21:41
  • 1
    $\begingroup$ That's ok, you have to adapt the viewpoint far away ( ViewVector-> {100{0,0,1},{0,0,-1}})to get "parallel projection! $\endgroup$ – Ulrich Neumann Dec 18 '18 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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