- pl_filltype_r (lp,0);
- pl_fcircle_r (lp, centre_x, centre_y, radius);
-}
-
-/* Fill a segment with the current fill colour */
-static void
-fill_segment(plPlotter *lp,
- double x0, double y0,
- double radius,
- double start_angle, double segment_angle)
-{
-
- const double start_x = x0 - radius * sin(start_angle);
- const double start_y = y0 + radius * cos(start_angle);
-
- const double stop_x =
- x0 - radius * sin(start_angle + segment_angle);
-
- const double stop_y =
- y0 + radius * cos(start_angle + segment_angle);
-
- assert(segment_angle <= 2 * M_PI);
- assert(segment_angle >= 0);
-
- if ( segment_angle > M_PI )
- {
- /* Then we must draw it in two halves */
- fill_segment(lp, x0, y0, radius, start_angle, segment_angle / 2.0 );
- fill_segment(lp, x0, y0, radius, start_angle + segment_angle / 2.0,
- segment_angle / 2.0 );
- }
- else
- {
- pl_move_r(lp, x0, y0);
-
- pl_cont_r(lp, stop_x, stop_y);
- pl_cont_r(lp, start_x, start_y);
-
- pl_arc_r(lp,
- x0, y0,
- stop_x, stop_y,
- start_x, start_y
- );
-
- pl_endpath_r(lp);
- }