How do programs draw function graphs?

Click For Summary
SUMMARY

Computer programs like GeoGebra, MATLAB, and Wolfram Alpha plot function graphs primarily through value calculation and interpolation. These tools evaluate function values over a specified range to generate a list of points (x, y) that can be linearly interpolated. While general-purpose plotting routines do not assume properties about the data source, they may allow users to specify interpolation methods such as linear or spline. Constructing graphs for arbitrary functions geometrically is not feasible; instead, numerical evaluation is the standard approach.

PREREQUISITES
  • Understanding of function evaluation and interpolation techniques
  • Familiarity with mathematical software tools like GeoGebra and MATLAB
  • Knowledge of basic calculus concepts, including derivatives and maxima
  • Awareness of curve sketching principles and techniques
NEXT STEPS
  • Explore the interpolation methods available in MATLAB and GeoGebra
  • Learn about curve sketching techniques through online resources like BBC Bitesize
  • Investigate the construction of mathematical curves using linkages and mechanical methods
  • Study the properties of rational and transcendental functions for graph construction
USEFUL FOR

Mathematicians, educators, students, and software developers interested in graphing functions and understanding the computational methods behind plotting in mathematical software.

Trysse
Messages
75
Reaction score
16
Hi there,

I was wondering how computer programs such as geogebra or more advanced packages such as mathlab or wolfram plot graphs for functions.

Do they calculate values and interpolate? Do they take derivates to determine maxima and turning points? Do they have any other way to somehow construct the curve?

Are there different approaches depending on the type of function?
 
Technology news on Phys.org
Basically, they evaluate the value of the function, over a specified range of the argument. That gives a list of points(x,y), that can be linearly interpolated.
They do not need to identify turning points, or the gradient of the line, as that will be done by the interpolator when it plots the function.
 
Trysse said:
Hi there,

I was wondering how computer programs such as geogebra or more advanced packages such as mathlab or wolfram plot graphs for functions.

Do they calculate values and interpolate? Do they take derivates to determine maxima and turning points? Do they have any other way to somehow construct the curve?

Are there different approaches depending on the type of function?
General-purpose plotting routines will not do anything that assumes something about the source of the data (like whether it comes from a function that has a derivative). They need to be able to plot data of all sorts. On the other hand, they may allow the user to specify how the data will be interpolated (linear, spline, etc.)
 
Ok. Thanks for the quick responses.

That means calculate and interpolate. Right?

Are there ways to construct graphs for arbitrary functions (on a computer or on apiece of paper)?

I know of some functions such as $$f(x)=ax+b$$ or $$f(x)=\sqrt{1-x^2}$$ that I can construct with ruler or a compass but what about arbitrary functions?

Can I construct or must I calculate and plot.

What constraints must a function satisfy so I can construct? Do these functions belong to some group or category of functions that has a name?
 
Conics?
 
Trysse said:
Are there ways to construct graphs for arbitrary functions (on a computer or on apiece of paper)?
There may well be ways, but you must first specify your arbitrary function.

Obviously, no computer is going to construct a function geometrically, when it can evaluate it and plot it numerically.
 
Trysse said:
Ok. Thanks for the quick responses.

That means calculate and interpolate. Right?

Are there ways to construct graphs for arbitrary functions (on a computer or on apiece of paper)?

I know of some functions such as $$f(x)=ax+b$$ or $$f(x)=\sqrt{1-x^2}$$ that I can construct with ruler or a compass but what about arbitrary functions?

Can I construct or must I calculate and plot.

What constraints must a function satisfy so I can construct? Do these functions belong to some group or category of functions that has a name?
On a computer, you can always make a large table of evaluated points.
Manually, it is good to find the zeros, poles, inflection points, maximums, minimums, asymptotic values, etc. And if they are compositions of functions that you can graph, then you can make a series of graphs following the composition.
 
Baluncore said:
but you must first specify your arbitrary function.
how about say $$f(x)=x^2$$ or $$f(x)=\frac{1}{\sqrt{1-x^2}}$$?

My guess is, that those graphs cannot be constructed. One reason is that they go to infinity. But maybe there is a way to construct the graph within a certain range. I still guess it is not possible. However, this guess is based purely on the fact that I don't know how to do it. And by construct I do not mean "more or less" but exactly.
 
Trysse said:
how about say $$f(x)=x^2$$ or $$f(x)=\frac{1}{\sqrt{1-x^2}}$$?

My guess is, that those graphs cannot be constructed. One reason is that they go to infinity. But maybe there is a way to construct the graph within a certain range. I still guess it is not possible. However, this guess is based purely on the fact that I don't know how to do it. And by construct I do not mean "more or less" but exactly.
Obviously a complete graph over the entire real line can't be constructed, but a program can draw a graph ove a finite interval. The graph of the first function is a parabola and that of the second function has a sort of parabolic shape in the interval (-1, 1).
 
  • #10
  • Like
Likes   Reactions: FactChecker
  • #11
Trysse said:
However, this guess is based purely on the fact that I don't know how to do it.
Curve sketching is an important subject in elementary mathematics as it gives one an intuitive insight into important functions, their roots and derivatives. You can learn about it from sites such as https://www.bbc.co.uk/bitesize/guides/zc62srd/revision/7

The topic is summarized on the Wikipedia page https://en.wikipedia.org/wiki/Curve_sketching and this page has references to books with more information. These books were published over a century ago from which you can infer two things:
  • the books are out of copyright and copies can be found by searching the internet; and
  • "advanced curve sketching" as a topic in intself is not something that people have been interested in for a very long time.
Trysse said:
And by construct I do not mean "more or less" but exactly.
What do you mean by 'construct a graph exactly'?
 
  • #12
Trysse said:
Can I construct or must I calculate and plot.

What constraints must a function satisfy so I can construct? Do these functions belong to some group or category of functions that has a name?
Are you asking about constructing a graph using some physical property like:
1) a circle using a protractor,
2) an ellipse using a string with its ends at the foci,
3) a straight line using a ruler,
etc.?
If so, that is a good question.
There might be a lot more that I am not familiar with and I do not know of any general term or categorization for them.
 
  • #13
Trysse said:
My guess is, that those graphs cannot be constructed.
The graph y = x2 can be constructed.
https://en.wikipedia.org/wiki/Parabola#Pin_and_string_construction

The other would be more difficult, as it involves three tricks, but I believe it would be possible using pins, linkages and string. There have been many books written on the subject of the generation of mathematical curves using linkages.

How To Draw A Straight Line; A Lecture On Linkages. A. B. Kempe, (1877).

I. I. Artobolevskii and W. Johnson (Auth.) - Mechanisms for the Generation of Plane Curves - Macmillan (1964).

Kinematics, Dynamics, and the Design of Machinery - K. J. Waldron and G. L. Kinzel - (1944, 2004).

There is no way a computer would use any of those methods to draw a graph today. The positions of the points and lines would be computed numerically.
 
  • Like
Likes   Reactions: FactChecker
  • #14
Baluncore said:
The graph y = x2 can be constructed.
https://en.wikipedia.org/wiki/Parabola#Pin_and_string_construction

The other would be more difficult, as it involves three tricks, but I believe it would be possible using pins, linkages and string. There have been many books written on the subject of the generation of mathematical curves using linkages.

How To Draw A Straight Line; A Lecture On Linkages. A. B. Kempe, (1877).

I. I. Artobolevskii and W. Johnson (Auth.) - Mechanisms for the Generation of Plane Curves - Macmillan (1964).

Kinematics, Dynamics, and the Design of Machinery - K. J. Waldron and G. L. Kinzel - (1944, 2004).

There is no way a computer would use any of those methods to draw a graph today. The positions of the points and lines would be computed numerically.
Interesting.
So if there is a good way to do multiplication any polynomial can be constructed.
Then if there is a good way to construct 1/x, any rational function can be constructed.

If there is a construction of ##e^x## all the trigonometric and hyperbolic functions can be constructed.
Finally, the inverse of any constructable graph is easy.
 
  • #15
FactChecker said:
If there is a construction of all the trigonometric and hyperbolic functions can be constructed.
Finally, the inverse of any constructable graph is easy.
Some transcendental functions are easier than a square. For example, sine and cosine are trivial, given a shaft and a crank. Tidal prediction machines sum the Fourier components with one long wire or chain that snakes through the machine.
https://en.wikipedia.org/wiki/Tide-predicting_machine

During WW2, the ballistic calculations on battleships were all done mechanically, including the atmospheric and Coriolis corrections.
https://en.wikipedia.org/wiki/Mark_I_Fire_Control_Computer

Accurate involute gear teeth are "generated" by a rotating straight edged hob.
https://en.wikipedia.org/wiki/Hobbing
 
  • Like
Likes   Reactions: FactChecker

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
849
  • · Replies 1 ·
Replies
1
Views
857
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K