MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Locator question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79306] Re: Locator question
  • From: Mike <mjp.1 at comcast.net>
  • Date: Tue, 24 Jul 2007 06:03:36 -0400 (EDT)

Bob,

You posted: 

Manipulate[
  Show[
   Plot[g[x], {x, 0, 2 \[Pi]}],
   p[[2]] = g@p[[1]]; slope = D[g[x], x] /. x -> p[[1]];
   Plot[p[[2]] + slope (x - p[[1]]), {x, 0, 2 \[Pi]}],
   PlotLabel ->
    Style["slope of f(x)= " <>
      ToString[NumberForm[slope, {6, 4}]]]], {{g, Sin,
    "function"}, {Sin -> TraditionalForm[Sin[x]],
    Cos -> TraditionalForm[Cos[x]], #^2 & -> TraditionalForm[x^2]},
   ControlType -> PopupMenu}, {{p, {0, 0}}, Locator}]

Which tracks the line representing the slope at the point and ties it to the selected graph. Now...if I could get that darn locator to work!

Thanks,

Mike


  • Prev by Date: Usage Messages and Font Size in 6.0.1
  • Next by Date: Re: general
  • Previous by thread: Locator question
  • Next by thread: Re: Locator question