0
$\begingroup$

A surface of revolution is computed from ode integration and plotted with ParametricPlot3D

smax = 3;
sor = {PH'[s] == 0.4, PH[0] == 0.012, R'[s] == Sin[PH[s]], 
   Z'[s] == Cos[PH[s]], R[0] == 1.2, TH'[s] == 0.01, TH[0] == 0.0, 
   Z[0] == 0};
NDSolve[sor, {PH, TH, R, Z}, {s, 0, smax}];
{th[t_], ph[t_], r[t_], z[t_]} = {TH[t], PH[t], R[t], Z[t]} /. 
   First[%];
xyz = ParametricPlot3D[{r[s] Cos[th[s] + v], r[s] Sin[th[s] + v], 
   z[s]}, {s, .0, smax}, {v, 0, 2 Pi}, PlotLabel -> "xyz CORD-LINES", 
  MeshFunctions -> {#1 &, #2 &, #3 &}, PlotStyle -> Yellow, 
  Mesh -> {8, 6, 5}]
i = 1; $ = ","; ds = 0.25;
Table[{i++, $, s, $, r[s] Cos[th[s]] $, r[s] Sin[th[s]] $, 
   z[th[s]], $}, {s, 0., smax, ds}] // TableForm
helico = ParametricPlot3D[{u Cos[v], u Sin[v], v}, {u, -1, 1}, {v, 0, 
   Pi}, PlotLabel -> HELICOID, Mesh -> 16, 
  MeshFunctions -> {#1 &, #2 &, #3 &}]

By change of variable or by any other means of transformation is there a way to compute and plot the same surface showing x=const, y=const, z= const. raster lines similar to what is seen using Cartesian coordinates in implicit ContourPlot3D?

Many thanks!

EDIT1:

However if out of each of (8,6,5) (x,y),(y,z),{z,x) intersections by selecting one identifiable intersection how can we, ( say for a constant y value ) make a Tableof (x,z) coordinates?

enter image description here

$\endgroup$

1 Answer 1

3
$\begingroup$

With ParametricPlot3D, you can choose MeshFunctions to show constant x,y,z, instead of the default which shows constant values of the parametric variables. For example:

plot = ParametricPlot3D[{Sin[u] Cos[v], Sin[u] Sin[v], 2 Cos[u]}, {u, 0, 1}, {v, 3, 6},
  MeshFunctions -> {#1 &, #2 &, #3 &}]

You can combine this with the Mesh option if you want to specify which x,y,z values to show.

The mesh lines are Line objects in the graphics. You can extract the points on the mesh lines using, e.g.,

meshLines = Cases[Normal@plot,_Line,\[Infinity]]

Normal@plot converts from GraphicsComplex to actual coordinates for the lines.

You can then plot the mesh curves by themselves, e.g.,

Graphics3D[meshLines]

or extract point coordinates from any of these lines. E.g., the points in the 1st mesh line:

meshLines[[1,1]]
$\endgroup$
3
  • $\begingroup$ Thanks. I have changed the question a bit per your answer. How do we get coordinates of all or any of mesh intersections with NDSolve ? $\endgroup$
    – Narasimham
    Commented Sep 9, 2022 at 13:40
  • $\begingroup$ I described how to extract the mesh lines from the plot. If your main interest is a table of points from an NDSolve solution, instead of making a plot and then extracting mesh lines, you could use FindRoot with the solution to solve for points with, e.g., constant x. $\endgroup$
    – tad
    Commented Sep 9, 2022 at 18:28
  • $\begingroup$ Thanks very much for taking out the time for the detailed answer. I have still have a few minor related clarifications. Hoping to continue with the learning process. $\endgroup$
    – Narasimham
    Commented Sep 9, 2022 at 19:54

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.