As shown, a line segment between two points \(x\) and \(y\) in this shape lies entirely within the shape. In fact, this is true for any pair of points in the shape. Therefore, this shape is convex. For comparison, the following shape is not convex:
The fact that part of the line segment between \(x\) and \(y\) (both inside the shape) lies outside the shape proves that this shape is not convex.
Formally, a set \(S\) is convex if
use non-Wikipedia images and remove the attribution