13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Absolute and Relative CoordinatesMost of <strong>Turbo</strong> <strong>Basic</strong>'s plotting statements can specify coordinates in both relativeand absolute form.In absolute form, an (x,y) coordinate pair describes exactly where an operationshould occur; for example, PSET (50,75) turns on the pixel 50 pixels from the left ofthe screen and 75 pixels from the top.In relative form, a coordinate is specined relative to the LPR and represents thehorizontal and vertical displacement from the LPR. This form uses the keywordSTEP to differentiate it from standard absolute coordinates. For example, if theLPR is (60,75):PSET(10,20}specines the point (10,20), andPSET STEP (10,20)specines the point (70,95),10 over and 20 down from the LPR. A negative relativecoordinate value specines a point above or to the left of the LPR.Redefining Screen CoordinatesIf you aren't comfortable with this addressing system, use the WINDOW statementto change the mapping between the (x,y) pairs given in plotting statementsand the pixels on the screen. For example:WINDOW (-1,1) - (1,-1)redennes screen coordinates to more closely resemble the cartesian plane of analyticalgeometry, with the origin in the middle, and y values- increasing as you moveupward. After this WINDOW statement, PSET (0,0) turns on physical pixel(100,160), PSET (-1, -1) turns on the screen's lower left-most pixel, and PSET(.5,.5) turns on physical pixel (220,50) in the middle of the upper right-hand quad,.rant. Using WINDOW can greatly simplify mathematical charts and graphs.The VIEW statement allows you to create an active region, or "window; on thegraphics screen, and to optionally specify coordinates relative to the window'supper left-hand corner. You cannot manipulate pixels outside of the window.<strong>Turbo</strong> <strong>Basic</strong>: The Language 113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!