Message Boards Message Boards

[GiF] Tangents (Tangent lines to a Bessel function)

Tangent lines to a Bessel function


This shows 900 tangent lines to the Bessel function $J_4$. The Bessel function itself is not explicitly shown at all, but, as in Bessel, the graph of the function emerges quite clearly from the approximations.

One note: the GIF is made up out of 1801 frames, which seems to make the Javascript on the post preview page very unhappy, and the original file output by Mathematica was 275 MB(!). Using gifsicle to reduce the color palette and only record diffs between consecutive frames, I was able to get this down to 2.9 MB, or about 100 times smaller (and thereby actually reasonable to post online).

Here's the code, which makes use of one simple function that returns the tangent line to a function at a given point:

TangentLine[f_, x_] := InfiniteLine[{x, f[x]}, {1, f'[x]}];

DynamicModule[{f, b = N[BesselJZero[4, 6]], n = 450, 
  cols = RGBColor /@ {"#FF5200", "#003355"}},
 f[x_] := BesselJ[4, x];
   {Opacity[.1], cols[[1]],
    Table[TangentLine[f, x], {x, Max[-b, s - 2 b], Min[s, b], b/n}]},
   PlotRange -> {{-b, b}, {-2, 2}}, AspectRatio -> 2/3, 
   ImageSize -> 540, Background -> cols[[-1]]],
  {s, -b, 3 b}]

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract