MathGroup Archive 2010

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

Search the Archive

Re: Mimicking the TI calculator graph "trace" function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113212] Re: Mimicking the TI calculator graph "trace" function
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 19 Oct 2010 05:54:26 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Don't know anything about the calculator but this may be close to what you want:

f[x_] := (x + 2) (x - 1) (x - 3)

Manipulate[
 Module[{fp, pt, xdel = 0.1, xmin = -3, xmax = 4},
  Plot[f[x], {x, xmin, xmax},
   Frame -> True,
   Epilog -> {Text[
      {p, NumberForm[fp = f[p], 3]},
      pt = {p, fp},
      {If[p < (xmax + xmin)/2, -1.5, 1.5],
       If[fp < 0, -1, 1]}],
     If[fp == 0 ||
       
       Abs[f'[p]] < Abs[f'[p - xdel]] &&
        
        Abs[f'[p]] < Abs[f'[p + xdel]],
      Directive[AbsolutePointSize[6], Red],
      Directive[AbsolutePointSize[4], Blue]],
     Point[pt]}]],
 {{p, -3, x}, -3, 4, 0.1,
  Appearance -> "Labeled"}]


Bob Hanlon

---- John Accardi <accardi at accardi.com> wrote: 

=============
Hello ....

I'm trying to find the easiest way to get Mathematica to do what a TI-84 
calculator does with the "trace" button on a graph.  (displays x,y 
coordinates at tracing cursor positions).  Alternately, I could live 
with having the intersection point(s) of two graphs dynamically display, 
with label(s), on a plot, along with the function graphs.  I know I can 
do this in a table of values, but I want to see point and label on the 
graph plot.

This document describes much of it, but you have to hard code the 
solution point to create the point label:

http://amath.colorado.edu/computing/Mathematica/labelpoints/

(The above document contains a link to the *.nb being described.)

I guess I am looking for any code that exists where the point label is 
created dynamically after a solution point is calculated and included in 
the plot.

This seems like a very common thing to want to do but I cannot seem to 
find anything in the archive/forum that does anything like this.

Thanks for any insights.

Gianni




--

Bob Hanlon



  • Prev by Date: Re: evaluation of a non-visible dynamic[]
  • Next by Date: Re: Visualizing a geometric problem
  • Previous by thread: Mimicking the TI calculator graph "trace" function
  • Next by thread: simplifying an expression using non-commutative algebra