Zx Spectrum Manual
CHAPTER Chapter 17 Graphics Summary PLOT, DRAW, CIRCLE POINT pixels In this chapter we shall see how to draw pictures on the ZX Spectrum. The part of the screen you can use has 22 lines and 32 columns, making 22*32=704 character positions. As you may remember from Chapter 16, each of these character positions is made of an 8 by 8 square of dots, and these are called pixels (picture elements). A pixel is specified by two numbers, its coordinates. The first, its x coordinate, says how far it is across from the extreme left-hand column. (Remember, x is a cross), the second, its y coordinate, says how far it is up from the bottom (wise up). These coordinates are usually written as a pair in brackets, so (0,0), (255,0), (0,175) and (255,175) are the bottom left-, bottom right-, top left- and top right-corners. The statement PLOT x coordinate, y coordinate inks in the pixel with these coordinates, so this measles program 18 PLOT INT (RND*2561, INT (RND*1761: INPUT a$: GO TO 10 plots a random point each time you press ENTER. Here is a rather more interesting program. It plots a graph of the function SJN (a sine wave) for values between 0 and 217. 10 FOR n=6 TO 255 26 PLOT n,66+80*SIN (n/l28*PII 30 NEXT n This next program plots a graph of SQR (part of a parabola) between 0 and 4: 10 FOR n=O TO 255 26 PLOT n,86*SQR b1B41 30 NEXT n Notice that pixel coordinates are rather different from the line and column in an AT item.
[Show full text]