3
votes
$\begingroup$

I want to draw a normalized tangent arrow, so I use the Normalize command as follows:

tangent = 
  Table[{{t, Sin[t]}, {t, Sin[t]} + Normalize @ {1, Cos[t]}}, {t, -π, π, π/2}];
Plot[Sin[x], {x, -2 π, 2 π}, 
  PlotRange -> 2, Epilog -> {Red, Arrowheads[0.02], Arrow /@ tangent}]

and I get this plot:

enter image description here

Seems good, but if take a close look at the length of the arrows, you'll see that the length is not normalized at all. I've tried the Show and Graphics command instead of Epilog, but got the same plot.

Can someone tell me what I missed here?

$\endgroup$

closed as off-topic by m_goldberg, Jens, ubpdqn, Yves Klett, RunnyKine Aug 4 '14 at 4:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Jens, ubpdqn, Yves Klett, RunnyKine
If this question can be reworded to fit the rules in the help center, please edit the question.

locked by Mr.Wizard Jul 25 '15 at 12:57

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. See the help center for guidance on writing a good question.

Read more about locked posts here.

  • 3
    $\begingroup$ Your plot is distorted by the default aspect ratio of 1/GoldenRatio. Add AspectRatio -> Automatic to your plot options $\endgroup$ – m_goldberg Aug 4 '14 at 3:56
5
votes
$\begingroup$

This issue here is aspect ratio: Using the following slight adaptation of your code:

tangent = 
  Table[{{t, Sin[t]}, {t, Sin[t]} + 
     Normalize@{1, Cos[t]}}, {t, -\[Pi], \[Pi], \[Pi]/2}];
Plot[Sin[x], {x, -2 \[Pi], 2 \[Pi]}, PlotRange -> 2, 
 Epilog -> {{Red, Arrowheads[0.02], Arrow /@ tangent}, 
   Circle[{#, Sin[#]}] & /@ Range[-\[Pi], \[Pi], \[Pi]/2]}]

enter image description here

However, specifying aspect ratio:

tangent = 
  Table[{{t, Sin[t]}, {t, Sin[t]} + 
     Normalize@{1, Cos[t]}}, {t, -\[Pi], \[Pi], \[Pi]/2}];
Plot[Sin[x], {x, -2 \[Pi], 2 \[Pi]}, PlotRange -> 2, 
 Epilog -> {{Red, Arrowheads[0.02], Arrow /@ tangent}, 
   Circle[{#, Sin[#]}] & /@ Range[-\[Pi], \[Pi], \[Pi]/2]}, 
 AspectRatio -> Automatic]

resolves matters: enter image description here

$\endgroup$
  • $\begingroup$ Thanks a lot. I have another small question. Since many of the default values of options in Mathematica is Automatic, Why WRI choose the default value of the AspectRatio as 1/GoldenRatio? I mean, why not choose Automatic, then in the algorithms(or in the front-end or something like that), Automatic use 1/GoldenRatio as default value? This seems more coherent to me. $\endgroup$ – luyuwuli Aug 4 '14 at 4:30
  • $\begingroup$ @luyuwuli I am afraid I cannot answer that...as humans we make so many arbitrary decisions and adopt arbitrary conventions, August having 31 days, Julian v Gregorian calendar, tau v pi as well as the countless debates in everyday life...I am sure there were reasons, like appeal of golden ratio to human aesthetics etc $\endgroup$ – ubpdqn Aug 4 '14 at 4:52
  • $\begingroup$ Hahaha... Yes, I agree. I ask this because I've suffered a lot in the AspectRatio issue. $\endgroup$ – luyuwuli Aug 4 '14 at 5:02

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