0
$\begingroup$

Consider a pseudosphere,

$\qquad \{x,y,z\} = \{\sin[u] \cos[v],\, \sin[u] \sin[v], \, \log[\tan[u/2]\}$.

Now I want to draw the figure.

 ParametricPlot3D[
  {Sin[u] Cos[v], Sin[u] Sin[v], Log[Tan[u/2]] + Cos[u]}, 
  {u, -2 π, 2 π}, {v, -2 π, 2 π}]

Now I want to have the plot show the following:

  1. All points with equal third coordinate has the same color.

  2. A curve with constant third coordinate is shown on the surface. it is equal to $\cos(u)\cot(u) = 0$.

I don't know how to combine these requirements. I tried

ParametricPlot3D[
  {Sin[u] Cos[v], Sin[u] Sin[v], Log[Tan[u/2]] + Cos[u]}, 
  {u, -2 π, 2 π}, {v, -2 π, 2 π}, 
  PlotStyle -> Thick, 
  Mesh -> 10, 
  MeshFunctions -> {ConditionalExpression[#, f'[#] == 0] &}] 

but it didn't help.

Any help I get here will be appreciated!

$\endgroup$
5
  • $\begingroup$ Something like this MeshFunctions -> {#3 &}, ColorFunction -> (Hue[#3] &)? $\endgroup$ Commented Mar 5, 2018 at 19:30
  • $\begingroup$ @swish I guess that doesn't give us a $cos(x) = 0 $ property $\endgroup$ Commented Mar 5, 2018 at 19:54
  • $\begingroup$ And where $cos(x)=0$ comes from? $\endgroup$ Commented Mar 5, 2018 at 20:01
  • $\begingroup$ @swish from second property : curve with constant third coordinate is curve according to $z'(u) = 0 = cos(u)cot(u)$, i.e. $cos(u) = 0$ $\endgroup$ Commented Mar 5, 2018 at 20:23
  • $\begingroup$ @swish I thought about using ConditionalExpression in MeshFunctions $\endgroup$ Commented Mar 5, 2018 at 20:24

2 Answers 2

2
$\begingroup$

The following gives a plot of the pseudosphere with coloring according to its z-coordinates.

p1 = 
  ParametricPlot3D[
    {Sin[u] Cos[v], Sin[u] Sin[v], Log[Tan[u/2]] + Cos[u]},
    {u, -2 π, 2 π}, {v, -2 π, 2 π},
    PlotPoints -> 20,
    MaxRecursion -> 3,  
    ColorFunction -> ((Hue[Abs@#3]) &),
    ColorFunctionScaling -> False,
    Mesh -> None,
    Lighting -> "Neutral"]

plot1

To find where Cos[u] Cot[u] == 0 holds in the domain -2 π <= u <= 2 π, I evaluate

uVals = 
  DeleteDuplicates[u /. Solve[Cos[u] Cot[u] == 0 && -2 π <= u <= 2 π, u]]

which gives

{-((3 π)/2), -(π/2), π/2, (3 π)/2}

The z-coordinates corresponding to these values of u are

zVals = Log[Tan[#/2]] + Cos[#] & /@ uVals

{0, I π, 0, I π}

So the only curve satisfying your condition is at z == 0, which occurs at two u values and I arbitrarily pick u == π/2.

The curve can be plotted with

p2 = 
  ParametricPlot3D[
    Evaluate[{Sin[u] Cos[v], Sin[u] Sin[v], Log[Tan[u/2]] + Cos[u]} /. u -> π/2],
    {u, -2 π, 2 π}, {v, -2 π, 2 π},
    MeshStyle -> Directive[Black, AbsoluteThickness[4]]];

p2 is not interesting plotted on its own, so I will only show it combined with p1, which I now give

Show[p1, p2]

plot2

enter image description here

$\endgroup$
0
$\begingroup$

Specify all the solution points for Mesh parameter:

Mesh -> {u /. Solve[z'[u] == 0 && -2 \[Pi] <= u <= 2 \[Pi], u], 0}
$\endgroup$
2
  • $\begingroup$ z isn't a function as I think $\endgroup$ Commented Mar 5, 2018 at 22:04
  • $\begingroup$ @openspace z[u_]=Log[Tan[u/2]] + Cos[u] $\endgroup$ Commented Mar 5, 2018 at 22:24

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.