# Convexity/Examples of convex sets

## Example 1

[edit | edit source]In a two-dimensional vector space, a **parallelogram** is a set such that in some suitably chosen basis **x**, **y** of the space, the set consists of the points a**x** + b**y** with 0 < a < 1, 0 < b < 1.

All parallelograms are convex. For, given any two points A, B in the parallelogram, we have

- A = a
**x**+ b**y** - B = c
**x**+ d**y**

with all coefficients being between 0 and 1. An arbitrary point on the line AB is

- C = (λa+(1-λ)c)
**x**+ (λb+(1-λ)d)**y**

with 0 < λ < 1. These coefficients are also between 0 and 1, so C is also in the parallelogram.

## Example 2

[edit | edit source]In Euclidean space, a **ball**, centre O radius r is the set of points within distance r of O, i.e. it is the interior of a sphere or hypersphere. (In two dimensions, a ball is often called a **disc**.)

All balls are convex. For, given any two points A, B in the ball, we have their distances from O less than r. For an arbitrary point C on AB, C = λA+(1-λ)B so

- dist(O,C) < λdist(O,A) + (1-λ)dist(O,B) < r.

Hence C is also in the ball.