Vector Graphics (SQA National 5 Computing Science): Revision Note

Exam code: X816 75

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

Vector graphics

What is a vector?

  • A vector image is created from mathematical equations and points

  • Only the instructions used to draw the image are stored

  • For example, a circle is defined by:

    • centre point [x, y]

    • radius

  • Typical examples of vector graphics include logos and clipart

  • Vector images are infinitely scalable

  • They can be resized without losing quality because the computer simply recalculates the mathematics

  • This makes them ideal when the same image must appear at many sizes, such as a logo printed on a pencil and also blown up for a billboard

An example of a vector graphic. A blue rectangular electronic sensor with a grid of square holes on top and four metallic pins extending from the base, viewed from an angle.

Vector graphic attributes

  • These attributes apply across all vector shapes

    • Co-ordinates define exact positions on the canvas

    • Fill colour controls the internal colour of shapes

    • Line colour controls the outline colour for shapes and lines

Graph with an x and y axis showing an orange square. Arrows indicate distances x and y from the origin to the lower left corner of the square.
Vector co-ordinates
  • The X value determines how far to the right the object should be placed

  • The Y value determines how far from the top the object should be placed

Common vector objects

  • Vector graphics use shapes that are described with co-ordinates and attributes

Rectangle

  • A rectangle is defined using a starting position and its size

  • Example attributes

Attribute

Example value

Meaning

x-co-ordinate

40

Starting horizontal position

y-co-ordinate

120

Starting vertical position

width

200

Width of the rectangle

height

80

Height of the rectangle

fill colour

blue

Internal colour

line colour

black

Outline colour

Ellipse

  • An ellipse is drawn using a centre point and two radii

  • Example attributes

Attribute

Example value

Meaning

centre x

150

Centre horizontal position

centre y

90

Centre vertical position

horizontal radius

50

Width from centre

vertical radius

25

Height from centre

fill colour

yellow

Internal colour

line colour

red

Outline colour

Line

  • A line uses two co-ordinates

  • Example attributes

Attribute

Example value

Meaning

start x

20

Starting horizontal position

start y

30

Starting vertical position

end x

200

Ending horizontal position

end y

200

Ending vertical position

line colour

green

Colour of the line

  • Lines do not have fill colour

Polygon

  • A polygon is any shape with three or more sides

  • It is drawn by joining multiple points in order

  • Example attributes

Attribute

Example value

Meaning

co-ordinates

[20,30], [80,30], [60,70], [20,50]

The corner points of the shape

fill colour

purple

Internal colour

line colour

black

Outline colour

Worked Example

A simple logo for a new "Secure Network" company is designed using vector graphics. The logo consists of a keyhole shape defined by a Polygon, which has been set with a grey fill.

(i) State two attributes of the keyhole object that a graphic designer can alter

[2]

(ii) The circular head of the key is defined by an Ellipse object. State one other object that is defined by the vector graphics method, other than the Polygon and the Ellipse

[1]

Answers

(i)

  • Line colour (or line thickness, if the outline is visible) [1 mark]

  • Co-ordinates (used to define the vertices/points of the polygon) [1 mark]

  • Fill colour (although specified as grey in the context, this is an attribute that can be altered) [1 mark]

  • Number of sides/vertices (for a polygon) [1 mark]

(ii)

  • Line [1 mark]

  • Rectangle [1 mark]

  • Text [1 mark]

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Robert Hampton

Author: Robert Hampton

Expertise: Computer Science Content Creator

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science & English Subject Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.