1. Sep 23, 2006

### physicsuser

Now I am trying to graph this thing.

Lets say I have x^2+x+10=0

So yah... I plot them for -10<x<10 and get the y values....

What I would like to know is how do I change the scale as to get zoom in and zoom out effect?

2. Sep 23, 2006

I'm assuming you mean on a calculator?

If you are using a ti calculator, then you can go to window>zoom. You can use the various types of zoom, such as zoombox, zoomin, etc...

but take note that these zooms change the x range, and y range.

3. Sep 23, 2006

### physicsuser

no... what is the math behind the zoom? I am writing a program. Do I just divide the whole thing to zoom in and multiply to zoom out?

4. Sep 24, 2006

What do you mean what is the math behind the zoom....

Maybe I'm making this harder than it is, so I'll just put my thoughts out.

Lets say you are graphing y=x.

Lets say:
x= -10..10
y= -10..10

Now setup a scale,
x_scl = 1
y_scl = 1

Now have the program draw the axis.
Now have the program plot within this window. You are using discrete values here, so you have a restricted domain. You will feed the function values from -10 to 10, such as r_n1 = -10, -9.9, -9.8, ... this will depend on the resolution of your drawing window. Each of these f(r_n) values gives you a point (r_n, f(r_n)) that will correspond to a pixel on the screen.

So now if you zoom in on the orgin for example, your domain would be x=-5..5 for example, and might have the discrete values, r_n2=-5,-4.95,-4.9,...
If we count r_n1 and r_n2 we notice they have the same number of elements. It's just that r_n2 is feeding the function a different set of values, and in return you are getting a different set of points to plot (the zoomed points).

...ahhh.
I see what you are saying now with the, "do I multiply, divide, ..." Honestly I don't know if that would work, I would have to play around with it. So I'm assuming you are using a plotting routine of the language then, and not creating a generic plotting function. If you don't need to create a plotting function, why don't you just use software out there to do your task.
A quick google search has this, http://www.mathworks.com/access/helpdesk/help/toolbox/dotnetbuilder/ug/index.html?/access/helpdesk/help/toolbox/dotnetbuilder/ug/bqhr8rn-1.html [Broken]

or you could use the free Maxima,
http://maxima.sourceforge.net/index.shtml

Last edited by a moderator: May 2, 2017
5. Sep 24, 2006

You can't plot x^2+x+10=0, because it represents an equation, which, by the way, has no solution. If you had an equation of this form which had a solution, the only thing you could plot would be the solution, which is represented by one or two points.

6. Sep 24, 2006

I'd imagine he wants to plot f(x)=x^2+x+10, and then see graphically that there are no real solutions to f(x)=0. Could be wrong though... all my assumptions in this thread seem to have failed thus far:)

7. Sep 24, 2006

You're right, of course he could plot f(x)=x^2+x+10 and g(x)=0 separately and see that f(x)=g(x) has no real solutions.

8. Sep 24, 2006

### physicsuser

Uhg... I don't know how to explain this....

I have a function f(x)=aX^2+bX+c
I want to plot point (x,f(x))--i know how to do that
I want to be able to zoom in/out the graph--need help here

here is an example

click the start button under "interactive tutorial" and check out the zoom in and zoom out buttons.

Last edited: Sep 24, 2006
9. Sep 24, 2006

Zooming in and zooming out would mean changing the interval in the domain of the function which is to be plotted in the sense of making it smaller to zoom in, or greater to zoom out.

10. Sep 24, 2006

### physicsuser

can you explain in more detail please?

11. Sep 24, 2006

Say you're plotting your function f on an interval I = [a, b], where the 'plot' means the graph, i.e. the set S = {x, f(x) : x is in [a, b]}. Now, zooming in would mean taking a proper subset of I, let's say I', and plotting the graph for I'.

12. Sep 24, 2006

how are you doing this?

13. Sep 24, 2006

### CRGreathouse

If you know how to plot points, then zooming is a simple matter of restricting the domain and choosing a new range. If your original interval was [a, b] then you could zoom to

$$\left[\frac{b+a}{2}-\frac{b-a}{2Z},\frac{b+a}{2}+\frac{b-a}{2Z}\right]$$

where Z is the zoom factor. To zoom in 2x, set Z = 2; to zoom in 100x, set Z = 100. Zoom out by using the reciprocal of the zoom factor (Z= 1/2 or Z = 1/100, in these examples).

You can change the range in the same way, or have it fit the equation by calculating the max and min of the function over the interval and setting the top and bottom on that basis.

14. Sep 24, 2006

### physicsuser

well I just go over a loop and plot points...

for(x=-10;x<10;x++)
{
y=a*x^2+b*x+c;
point(x,y);
}

15. Sep 24, 2006

What does,

for(x=-5;x<5;x=x+0.5)
{
y=a*x^2+b*x+c;
point(x,y);
}

do?

16. Sep 24, 2006

### physicsuser

nothing... it just makes more points

Last edited: Sep 24, 2006
17. Sep 24, 2006

it plots one point?

EDIT:
I see you edited your post.

Yes it makes more points... do you see how that is actually a zoomed in portion?

Last edited: Sep 24, 2006
18. Sep 24, 2006

### physicsuser

sorry didn't read what you said...

from 1 to 2 it will make points (x=1,y),(x=1.5,y),(x=2,y).... don't see how it would zoom in or out.

19. Sep 24, 2006