Definition of convex set says: an object is convex if for every pair of points within the object, every point on the straight line segment that joins them is also within the object. From: Wikipedia-Convex Set.
But I have also heard that if a curve has a upward curvature then its convex otherwise its convex. Have a look at the following figure. The black line is the curve and the red shaded portion is the set. Also, in the second set, it has upward and downward curves.
Only one thing I can think of is: though both sets have downward pointing curves, their curvatures are still positive, am I correct? And can anybody please elaborate on this?