1
$\begingroup$

I would like to put tick marks on a curve. In this trivial example I have managed to put some ticks.

ClearAll[fx, fy];
fx[t_] := 20 t - 0.1 t^2;
fy[t_] := 70 t - 5 t^2;
ParametricPlot[{fx[t], fy[t]}, {t, 0, 15}, AspectRatio -> Automatic, 
Frame -> True, Axes -> False, 
Epilog -> {Table[
Line[{{fx[t], fy[t]} + 3 #/Sqrt[#.#] &[{-fy'[t], 
    fx'[t]}], {fx[t], fy[t]} - 3 #/Sqrt[#.#] &[{-fy'[t], 
    fx'[t]}]}], {t, 0, 15, 0.5}]}]

Mathematica graphics

I began to write a module but then wondered if it had been done properly before but looked and could not find. My idea of a module is that it should enable the Epilog statement to look something like

Epilog -> {curveTicks[{fx, fy}, {t, tmin, tmax, tinc}]}

(Do I have to input the curve again?)

My suggestion for a specification is as follows: The process will involve taking the derivative to get the tangent and then turning through 90 degrees. This could be done by taking the derivative of the function (as I have begun to do) or by using the lines that make up the curve. Alternatively, there may be a method using Mesh. Taking the derivative for each tick mark seems expensive (above is a trivial example). The length of the tick mark should be default or input. The tick line should stick out equally on both sides of the curve. If the aspect ratio of the plot is not automatic the line should be rotated so that it is still perpendicular to the curve. There should be a method of labeling some tick marks. Has this been done already somewhere? Thanks.

$\endgroup$
3
  • 1
    $\begingroup$ Where were you looking? I've typed "ticks on curve" here: 31384, 8695 $\endgroup$
    – Kuba
    Commented Jun 5, 2014 at 22:20
  • $\begingroup$ @Kuba Thanks for pointing this out. My search found much on axes ticks but not on curves. Why did I miss your reference? Very helpful. $\endgroup$
    – Hugh
    Commented Jun 6, 2014 at 8:40
  • $\begingroup$ Well, this search engine is not perfect, slightly different query might change the results :) $\endgroup$
    – Kuba
    Commented Jun 6, 2014 at 8:45

0

Browse other questions tagged or ask your own question.