2
$\begingroup$

Here is the curve below. (written as a position vector)

r = {Cos[7 Pi*t], Cos[6.2*Pi*t], 2.5*t}
ParametricPlot3D[r, {t, 0, 2}]

I want to know how I can mark specific points on this curve, for example when t = 0 and t=1.

I would also like to label those points.

$\endgroup$
2
$\begingroup$

You can also use MeshFunctions but you need to "cheat" to include the t=0 point, e.g.

This is an edited post based on the correct comments by Oska and gpap. In my original answer I used the equivalent of Function[{x,y,z,t},z] though my intention was Function[{x,y,z,t},t]. I have corrected and now labelled the points.

r[t_] := {Cos[7 Pi*t], Cos[6.2*Pi*t], 2.5*t};
Show[ParametricPlot3D[r[t], {t, -0.01, 2}, MeshFunctions -> (#4 &), 
  Mesh -> {{0., 1}}, MeshStyle -> {PointSize[0.03], Red}], 
 Graphics3D[
  MapThread[
   Text[Framed[#1], r[#2], {1, -1}] &, {{"Position 1", 
     "Position 2"}, {0, 1}}]]]

enter image description here

$\endgroup$
  • $\begingroup$ is there a way i can label those points? $\endgroup$ – Lebouski Jun 17 '14 at 13:41
  • $\begingroup$ Shouldn't be the end point (t = 2) placed at the end of the curve? The t=1 point is wrong as well I'm afraid. $\endgroup$ – Öskå Jun 17 '14 at 14:14
  • $\begingroup$ @Oska the OP specifically mentions t=0 and t=1 hence my mesh points...I have only displayed and not labeled so will revise when I get chance $\endgroup$ – ubpdqn Jun 17 '14 at 20:07
  • $\begingroup$ What I meant is that.., since the function is plotted from 0 to 2, for t=2 the point should be in the end right? (at the top in that case) $\endgroup$ – Öskå Jun 17 '14 at 20:16
  • $\begingroup$ @Öskå is right. Your mesh function is now labelling the curve at the point where its z value is 1 and not at the point where the parameter t is 1. In ParametricPlot3D the option MeshFunctions takes four arguments, the x, y, z coordinates and the parameter along the curve. You can either replace MeshFunctions -> (#3/2.5 &) or MeshFunctions -> (#4 &) to get the right result. Then you'll have (at least) an upvote :) $\endgroup$ – gpap Jun 18 '14 at 9:22
5
$\begingroup$

You can use Graphics3D and Show:

r[t_] := {Cos[7 Pi*t], Cos[6.2*Pi*t], 2.5*t} ;
Show[ParametricPlot3D[r[t], {t, 0, 2}],
 Graphics3D[{
   PointSize@0.05, Point[r[#] & /@ {0, 1}],
   Text[#, #2] & @@@ 
    Thread[{{"Start", "Middle"}, {0, 0, .2} + # & /@ (r@# & /@ {0, 1})}]}]]

Mathematica graphics

$\endgroup$
1
$\begingroup$

Another way to use Mesh (credit: this answer by @BobHanlon )

r = {Cos[7 Pi*t], Cos[6.2*Pi*t], 2.5*t};

ParametricPlot3D[r, {t, 0, 2},  Mesh -> {{#, {PointSize[0], 
  Text[Framed@Style[Round@#, Red, Bold, 16], r /. t -> #]}} & /@ {0.00001, 1, 1.99999}}]

enter image description here

$\endgroup$

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.