Java Reference
In-Depth Information
FIGURE 2.8
A digitized picture with a small portion magnified
A traditional two-dimensional Cartesian coordinate system has two axes that
meet at the origin. Values on either axis can be negative or positive. The Java
programming language has a relatively simple coordinate system in which all of
the visible coordinates are positive. Figure 2.9 compares a traditional coordinate
system to the Java coordinate system.
Each point in the Java coordinate system is represented
using an ( x, y ) pair of values. The top-left corner of any Java
drawing area has coordinates (0, 0). The
KEY CONCEPT
Java's coordinate system has the
origin in the upper-left corner and all
visible coordinates are positive.
x -axis coordinates
get larger as you move to the right, and the
y -axis coordi-
nates get larger as you move down.
x
(0,0)
X Axis
Y Axis
y
(x,y)
X Axis
(0,0)
Y Axis
FIGURE 2.9
A traditional coordinate system and the Java coordinate system
 
Search WWH ::




Custom Search