Cover lesson · Computer Science · Year 7 · Beginner

Writing Precise Instructions to Draw Vector Shapes on a Grid

LNF: Numeracy → Using geometry skills → Position · DCF: Problem-solving and modelling

Name: Class: Date:

Cover teacher: you need no subject knowledge

What this practises: numeracy (coordinates and position) and computational modelling in Computer Science. Pupils trace a sequence of MOVE_TO and LINE_TO vector graphics commands on a first-quadrant coordinate grid from (0, 0) to (16, 12), spot and fix 3 wrong coordinates that distort the battlements of a Welsh castle tower badge, calculate its side lengths and perimeter, and write the exact command list for a symmetrical shield icon.

Board: open the supply teacher presentation for board slides, timers and script.

Print: this worksheet, one per pupil, and the stimulus sheet “Welsh castle badge coordinate grid and vector commands”, one between two. Pupils need a pencil and a ruler.

Run: 5 min starter and read stimulus · 5 min key words · 10 min Step 1, fix the 3 castle bugs and draw on Grid A · 10 min Step 2, calculate lengths and perimeter · 12 min Step 3, write shield commands · 5 min Step 4 and partner check · 3 min plenary check. Total 50 minutes.

Collect: this worksheet. Quick checks: fixed castle commands are Command 4: LINE_TO (5, 8), Command 6: LINE_TO (7, 10), Command 10: LINE_TO (11, 10); base width = 10 units, wall height = 8 units, outer rectangle perimeter = 36 units, full castle tower perimeter = 44 units; shield commands go MOVE_TO (5, 7) then LINE_TO (11, 7), (11, 5), (8, 3), (5, 5), (5, 7).

What you are doing

Ysgol Castell Gwyn is designing a new digital house badge showing a symmetrical Welsh castle tower with a shield inside it. Unlike a photograph made of tiny coloured squares (pixels), a vector graphic stores shapes as exact (x, y) coordinates and drawing commands so it can be scaled to any size without going blurry. You will debug three wrong coordinates in the castle tower file, draw the corrected badge on Grid A, calculate the tower’s perimeter, and write the vector commands for the inner shield.

Step 1: Spot and fix the 3 coordinate bugs in the castle tower

(a) Look at section 2 of the stimulus sheet. The castle tower should be symmetrical about the vertical line x = 8, with three battlements at height y = 10 and two gaps at height y = 8. Complete the table for the 3 buggy commands.

Command no. Buggy command in file What mistake was made? Corrected command
Command 4 LINE_TO (5, 9)
Command 6 LINE_TO (10, 7)
Command 10 LINE_TO (11, 11)

(b) Grid A: Using a pencil and ruler, plot the corrected castle tower on the coordinate grid below (and add the shield in Step 3).

Start (3, 2) Mirror line x = 8 0123 4567 891011 12131415 16 x 0123 4567 891011 12 y

Step 2: Calculate side lengths and the perimeter of the castle tower

Use the coordinates of your corrected castle tower to work out each measurement below. Show your calculation clearly.

Measurement Calculation using coordinates Answer (grid units)
(a) Width of tower base from (3, 2) to (13, 2)
(b) Height of left wall from (3, 2) to (3, 10)
(c) Perimeter of simple outer rectangle (3, 2), (3, 10), (13, 10), (13, 2)
(d) Full perimeter of the castle tower (including the four 2-unit vertical steps in the battlements)

Step 3: Write the vector commands for the symmetrical shield icon

Look at the Welsh shield icon in section 3 of the stimulus sheet. Draw the shield inside your castle tower on Grid A above, then complete the 6-command vector script starting at top-left corner A (5, 7) and moving clockwise through B, C, D, E and back to A.

Step What the virtual pen does Vector command (MOVE_TO or LINE_TO + coordinates)
1 Move pen to top-left corner A without drawing MOVE_TO (5, 7)
2 Draw top horizontal edge across to top-right corner B
3 Draw right vertical edge down to right shoulder C
4 Draw sloping edge down to the bottom point D on the mirror line
5 Draw sloping edge up to left shoulder E
6 Draw left vertical edge back up to A to close the shield

Step 4: Explain how vector graphics scale

The headteacher wants to print the school badge onto a 3-metre banner for the sports hall. Explain in 2 or 3 sentences why a vector graphic is better than a pixel (bitmap) image for this job, and state what mathematical change the computer makes to every (x, y) coordinate if it doubles the size of the badge from (0, 0).

Step by step

  1. 5 min Answer the starter question and read section 1 of the stimulus sheet.
  2. 5 min Review MOVE_TO, LINE_TO and the mirror line x = 8.
  3. 10 min Step 1: fix the 3 buggy commands in the table and draw the corrected castle tower on Grid A.
  4. 10 min Step 2: calculate the base width, wall height, outer rectangle perimeter and full castle perimeter.
  5. 12 min Step 3: draw the shield on Grid A and write all 6 vector commands in order.
  6. 5 min Step 4: explain why vector graphics scale cleanly and check your coordinates with a partner.
  7. 3 min Plenary: check your answers against the board.

Success criteria

If you finish early