## Exercises: Geometry

Apr 232018Before attempting these exercises, you should read the posts on points and vectors, simple shapes and polygons.

Before attempting these exercises, you should read the posts on points and vectors, simple shapes and polygons.

A polygon is any shape made of straight-line segments. Polygons are especially important in computer graphics and games, since they’re used in vector image formats and 3D models.

The most primitive geometric objects are points and vectors. But real geometric problems involve shapes like rectangles, triangles, circles, and polygons — or more complex collections of shapes, such as 3D models made of many polygons. In this post we’ll consider how computers can represent some simple kinds of shapes, and solve problems using these representations.

Many computing applications deal with geometric or spatial data. Here are some of the more obvious examples:

- 3D graphics in games and movies,
- Geographic data in maps and sat-navs,
- Physical simulations in science, engineering, and games,
- Positions of buttons, labels and other components in GUI applications,
- Vector image formats,
- Page layouts of web pages and other media.