lnf.cymru stimulus sheet · Computer Science · Year 7

Welsh castle badge coordinate grid and vector commands

Please do not write on this sheet so another pair can use it next lesson.

1. How vector graphics work

Computers store pictures in two main ways:

Our two vector commands today:
• MOVE_TO (x, y) lifts the pen and moves to horizontal position x, vertical position y.
• LINE_TO (x, y) draws a straight line from the current point to (x, y).

2. The buggy castle tower command file (for Step 1)

The castle tower badge is meant to be symmetrical about the vertical mirror line x = 8, with three flat battlements along the top at height y = 10 and two rectangular gaps dipping down to height y = 8. However, Commands 4, 6 and 10 contain coordinate bugs (shown as the dashed red lines on the diagram):

Vector command file (with 3 bugs in bold) What the buggy file draws vs the intended shape

1. MOVE_TO (3, 2) [bottom-left corner] 2. LINE_TO (3, 10) [top of left wall] 3. LINE_TO (5, 10) [top of left merlon] 4. LINE_TO (5, 9) [BUG 1: left gap depth] 5. LINE_TO (7, 8) [bottom-right of left gap] 6. LINE_TO (10, 7) [BUG 2: middle merlon] 7. LINE_TO (9, 10) [top-right of middle merlon] 8. LINE_TO (9, 8) [bottom-left of right gap] 9. LINE_TO (11, 8) [bottom-right of right gap] 10. LINE_TO (11, 11) [BUG 3: right merlon] 11. LINE_TO (13, 10) [top of right wall] 12. LINE_TO (13, 2) [bottom-right corner] 13. LINE_TO (3, 2) [base back to start]

(5, 9) (10, 7) (11, 11) 035 789 111316 278 91011

3. The symmetrical Welsh shield icon (for Step 3)

Once the castle tower is fixed, a 5-sided symmetrical shield icon is drawn inside the tower walls around the mirror line x = 8. Read the coordinates of corners A, B, C, D and E from the diagram below:

A (5, 7) B (11, 7) C (11, 5) D (8, 3) E (5, 5) 234 567 8910 11121314 123 456 789