Some subsets of
R are convex, and others are not, as in Figure
.
It is important to observe that convexity is a property of the whole
set, and not just of its boundary. For example, the circle
in
R
is not convex, but the circular disk
is convex.
Convexity can be tested by looking at line segments with both end points in the set. In fact, this test makes a good official definition, in any number of dimensions:
Definition. A subset of
R
is convex if for every
two points
in
, the whole line segment
is in
.
In
R, for example, a solid cube is convex, a
tetrahedron is convex, and a ball (solid sphere) is convex, but a torus
is not and a (hollow) sphere is not.