knp.de

– Tangents on a Logarithmic Spiral

Tangents on a Logarithmic Spiral

03/29/2015

In an earlier post I had the problem of logarithmic spiral …

logarithmic spiral

… that I needed a tangent for

spiral with fake tangent

As a shortcut, I used a vector orthogonal to the point vector from the origin.

fake tangent with origin vector

But that's not right. The green line represents the true tangent.

Let's use Mathematica to calculate the real tangent.

real and fake tangents

Calculating the true tangent

That was the definition of the spiral for some values of a and b.

curl[t_] := {
   Exp[a t] Cos[b t],
   -Exp[a t] Sin[b t]
}

That was our original definition of the tangent at point curl[t].

tangent[t_, o_] := Module[{
      p = curl[t],
      q},
   q = {p[[2]], -p[[1]]};
   p + o q
]

The real tangent can be calculated with the Limit[] function.

Just like we learned in school, the tangent is the limit of a secant with the two points approaching each other.

Thanks to Mathematica, that is calculated with ease.

tangent[t_, o_] := Module[{
      p = curl[t],
      q},
   q = Limit[
      (p - curl[t + h])/h,
      h -> 0];
   p - o Normalize[q]
]

Comments

Would you like to expand or correct an entry? Please send an e-mail to timm@knp.de. I will gladly publish interesting contributions on this site.