Convexity/Examples of convex sets

Example 1
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 ax + by with 0 < a < 1, 0 < b < 1.

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


 * A = ax + by
 * B = cx + dy

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


 * C = (&lambda;a+(1-&lambda;)c)x + (&lambda;b+(1-&lambda;)d)y

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

Example 2
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 = &lambda;A+(1-&lambda;)B so


 * dist(O,C) < &lambda;dist(O,A) + (1-&lambda;)dist(O,B) < r.

Hence C is also in the ball.