Graphics Reference
In-Depth Information
+ Y
X
+ X
Y
Fig. 5.1. The equation y =3 x + 2 using the xy Cartesian plane.
at the other end of the alphabet should substitute numbers. Which is why
equations such as y = ax 2 + bx + c are written the way they are.
Measurements to the right and left of the origin are positive and negative
respectively, and measurements above and below the origin share a similar
sign convention. Together, the axes are said to create a left-handed set of
axes, because it is possible, using one's left hand, to align the thumb with the
x -axis and the first finger with the y -axis. We will say more about left and
right-handed axes in Chapter 6.
The Cartesian plane is such a simple idea that it is strange it took so long
to be discovered. But even though it was invented almost 400 years ago, it
is central to computer graphics. However, although it is true that Descartes
showed how an orthogonal coordinate system could be used for graphs and
coordinate geometry, coordinates had been used by ancient Egyptians, almost
2000 years earlier!
Any point P on the Cartesian plane is identified by an ordered pair of
numbers ( x , y )where x and y are called the Cartesian coordinates of P.
Mathematical functions and geometric shapes can then be represented as lists
of coordinates inside a program.
5.1.1 Function Graphs
A wide variety of functions, such as y = mx + c (linear), y = ax 2 + bx + c
(quadratic), y = ax 3 + bx 2 + cx + d (cubic), y = a sin( x ) (trigonometric),
etc. create familiar graphs that readily identify the function's origins. Linear
functions are straight lines, quadratics are parabolas, cubics have an 's' shape,
and trigonometric functions often have a wave-like trace. Such graphs are used
Search WWH ::




Custom Search