Presentation is loading. Please wait.

Presentation is loading. Please wait.

GRAPHICS MODULE 14 STUDY BOOK. Graphic commands SCREEN - puts the screen into graphics mode WINDOW - allows scaling of the screen LINE - 3 formats –LINE.

Similar presentations


Presentation on theme: "GRAPHICS MODULE 14 STUDY BOOK. Graphic commands SCREEN - puts the screen into graphics mode WINDOW - allows scaling of the screen LINE - 3 formats –LINE."— Presentation transcript:

1 GRAPHICS MODULE 14 STUDY BOOK

2 Graphic commands SCREEN - puts the screen into graphics mode WINDOW - allows scaling of the screen LINE - 3 formats –LINE between 2 points –LINE from current cursor position to new point –LINE - coordinates define diagonal points and connecting lines automatically drawn PSET - draws a single point

3 When graphing on paper graph equation –over what range –expected values –scale –draw axis –calculate point –draw point

4 Graph equation on Computer Put computer into graphics mode over what range expected values scale draw axis calculate point draw point SCREEN WINDOW LINE LOOP /EQUATION LINE or PSET

5 Example SCREEN 12 FOR t = 1 to 10 s = t ^ 3 / 3 - 2 * t ^ 2 - 6 LINE -(t, s) NEXT

6 Graphics Commands SCREEN mode - defines resolution (number of pixels) and colours available e.g. SCREEN 12 WINDOW (x,y)-(x1,y1) - scales screen –x,y define upper left corner –x1,y1 define lower right

7 Drawing Commands PSET [STEP](x,y)[, colour] PSET (50,50), 2 draws a point at coordinate 50,50 in a colour #2 (green) uses absolute coordinates - the expression of a pixel’s location in terms of its x and y coordinates

8 PSET STEP (20,4) draws a point that is 20 pixels to the right and 4 pixels down for the last point referenced uses relative coordinates - location is expressed in terms of the x and y distances from the last referenced point

9 LINE Statement LINE [(x1, y1)] - (x2, y2) [, colour] [, B[F]] LINE (0,0) - (320,240), 4 draws a line from 0,0 (upper left) to 320,240 (centre) in red ( assuming no WINDOW) adding the B command draws a box whose diagonal coordinates are 0,0 and 320,240 in red adding a BF command draws a solid box as above in red

10 LINE - (639,479) draws a line from the current cursor position to point 639,479 (lower right) (again assuming no WINDOW statement)

11 Colours

12 SCREEN 12 WINDOW (-2, 130)-(15, -50) LINE (0, -50)-(0, 130), 3 LINE (-2, 0)-(15, 0), 3 PSET (0, 6) FOR t = 1 TO 10 STEP.01 s = t ^ 3 / 3 - 2 * t ^ 2 - 6 LINE -(t, s) NEXT LOCATE 10, 20 PRINT "graph f(t)" LOCATE 27, 65 PRINT "time,t, sec" graph equation –over what range –expected values –scale –draw axis –calculate point –draw point –loop until range exceeded

13 Adding text to graphics LOCATE row, column PRINT “text”, variables –text row between 1 and 30 and column between 1 and 80 –separate from graphics scaling –number of rows and columns depends on screen type and mode COLOR number –number defines colour, between 0 and 15 –all following printing will be done in this colour


Download ppt "GRAPHICS MODULE 14 STUDY BOOK. Graphic commands SCREEN - puts the screen into graphics mode WINDOW - allows scaling of the screen LINE - 3 formats –LINE."

Similar presentations


Ads by Google