Skip to content

Instantly share code, notes, and snippets.

@StrangeGirlMurph
Last active May 3, 2022 08:04
Show Gist options
  • Save StrangeGirlMurph/291049be25f2513294e33cfdcea6838d to your computer and use it in GitHub Desktop.
Save StrangeGirlMurph/291049be25f2513294e33cfdcea6838d to your computer and use it in GitHub Desktop.
Normalvector of curve - Mathematica
interval = 1.4;
f[t_] = {t^2, t^3 - t} (* Kurve *)
tf[t_] = D[f[t], t]; (* Tangentialvektor *)
ntf[t_] = tf[t]/Sqrt[tf[t] . tf[t]]; (* Normierter Tangentialvektor *)
af[t_] = D[ntf[t], t]; (* Normalvektor aber nicht normiert*)
kf[t_] = Norm[af[t]]; (* Krümmung *)
nf[t_] = af[t]/kf[t];(* Normalvektor *)
(* Was der Normalvektor nach der Vorlesung sein müsste (Einfach die Ableitung des Tangentialvektors) *)
awf[t_] = Normalize[D[tf[t], t]]; (* Angeblicher Normalvektor *)
Manipulate[
Show[
ParametricPlot[f[t], {t, -interval, interval}, PlotLabel -> kf[c]], (* Kurve *)
Graphics[{Green, Thick, Arrow[{f[c], f[c] + ntf[c]}]}], (* Normierter Tangentialvektor *)
Graphics[{Orange, Thick, Arrow[{f[c], f[c] + nf[c]}]}], (* Normalvektor *)
Graphics[{Red, Thick, Arrow[{f[c], f[c] + awf[c]}]}] (* Angeblicher Normalvektor *)
]
, {c, -interval, interval}
]

Zwei Beispiele:

1 2
image image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment