Skip to main content
added 43 characters in body
Source Link
user484
user484

As VF1's answer explains, the problem is indeed that the prime behaves strangely in tangent[γ]'. I replaced it with a function

d[f_] := Function[x, Evaluate[D[f[x], x]]]

based on the construction in VF1's answer, and now everything works as expected.

tangent[γ_] := Function[s, d[γ][s]/norm[d[γ][s]]]
normal[γ_] := Function[s, d[tangent[γ]][s]/norm[d[tangent[γ]][s]]]

γ1[s_] := {Cos[s], Sin[s], s} (* a helix! *)
γ2[s_] := {s, s^2, 0}
{normal[γ1][s], normal[γ2][s]} // Simplify[#, Assumptions :> s ∈ Reals] &
(* {{-Cos[s], -Sin[s], 0}, {-((2 s)/Sqrt[1 + 4 s^2]), 1/Sqrt[1 + 4 s^2], 0}} *)

As VF1's answer explains, the problem is indeed that the prime behaves strangely in tangent[γ]'. I replaced it with a function

d[f_] := Function[x, Evaluate[D[f[x], x]]]

and now everything works as expected.

tangent[γ_] := Function[s, d[γ][s]/norm[d[γ][s]]]
normal[γ_] := Function[s, d[tangent[γ]][s]/norm[d[tangent[γ]][s]]]

γ1[s_] := {Cos[s], Sin[s], s} (* a helix! *)
γ2[s_] := {s, s^2, 0}
{normal[γ1][s], normal[γ2][s]} // Simplify[#, Assumptions :> s ∈ Reals] &
(* {{-Cos[s], -Sin[s], 0}, {-((2 s)/Sqrt[1 + 4 s^2]), 1/Sqrt[1 + 4 s^2], 0}} *)

As VF1's answer explains, the problem is indeed that the prime behaves strangely in tangent[γ]'. I replaced it with a function

d[f_] := Function[x, Evaluate[D[f[x], x]]]

based on the construction in VF1's answer, and now everything works as expected.

tangent[γ_] := Function[s, d[γ][s]/norm[d[γ][s]]]
normal[γ_] := Function[s, d[tangent[γ]][s]/norm[d[tangent[γ]][s]]]

γ1[s_] := {Cos[s], Sin[s], s} (* a helix! *)
γ2[s_] := {s, s^2, 0}
{normal[γ1][s], normal[γ2][s]} // Simplify[#, Assumptions :> s ∈ Reals] &
(* {{-Cos[s], -Sin[s], 0}, {-((2 s)/Sqrt[1 + 4 s^2]), 1/Sqrt[1 + 4 s^2], 0}} *)
Source Link
user484
user484

As VF1's answer explains, the problem is indeed that the prime behaves strangely in tangent[γ]'. I replaced it with a function

d[f_] := Function[x, Evaluate[D[f[x], x]]]

and now everything works as expected.

tangent[γ_] := Function[s, d[γ][s]/norm[d[γ][s]]]
normal[γ_] := Function[s, d[tangent[γ]][s]/norm[d[tangent[γ]][s]]]

γ1[s_] := {Cos[s], Sin[s], s} (* a helix! *)
γ2[s_] := {s, s^2, 0}
{normal[γ1][s], normal[γ2][s]} // Simplify[#, Assumptions :> s ∈ Reals] &
(* {{-Cos[s], -Sin[s], 0}, {-((2 s)/Sqrt[1 + 4 s^2]), 1/Sqrt[1 + 4 s^2], 0}} *)