Re: Manipulate (from Wolfram Demonstrations)
- To: mathgroup at smc.vnet.net
- Subject: [mg76814] Re: [mg76774] Manipulate (from Wolfram Demonstrations)
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 28 May 2007 00:52:23 -0400 (EDT)
- Reply-to: hanlonr at cox.net
p is replaced by its definition x is then replaced by the rule x -> xi and xi is controlled by slider making p a number Bob Hanlon ---- Bruce Colletti <vze269bv at verizon.net> wrote: > Re Mathematica 6.0 under WinXP. > > The code below (from Wolfram Demonstrations site) plots a tangent at the point set by the slider. > > Point[{xi,p}] baffles me: Point requires two numbers, but p is a function...I don't see how it evaluates to a number AT THIS location in the Manipulate statement. > > What is the mechanism that makes p evaluate to a number? Is it somehow referring to Plot's {x,-2,2} ? > > Thankx. > > Bruce > > Manipulate[ > With[{p = a x^3 + b x^2 + c x, dx = .8}, > With[{pp = D[p, x]}, > Plot[p, {x, -2, 2}, Ticks -> None, PlotRange -> All, > Epilog -> ({Orange, PointSize[.02], Point[{xi, p}], > Thickness[.005], > Line[{{xi - dx, p - dx pp}, {xi + dx, p + dx pp}}]} /. > x -> xi)]]], {{xi, 0, Subscript[x, 0]}, -2, > 2}, Delimiter, {{a, -2, "a"}, -2, 2}, {{b, -2, "b"}, -2, > 2}, {{c, -2, "c"}, -2, 2}, ControllerLinking -> True] >