Previous: Solving Ellipses, Up: Ellipse Reference


31.11 Rectangles

const function: Rectangle out_rectangle (void)

Returns the Rectangle that surrounds the Ellipse.

          Ellipse e(origin, 3, 4, 45, 30, 17);
          e.shift(1, -1, 2);
          Rectangle r = e.out_rectangle();
          r.filldraw(black, gray);
          e.unfilldraw(black);


[Figure 172. Not displayed.]

Fig. 172.

const function: Rectangle in_rectangle (void)

Returns the Rectangle enclosed within the Ellipse.

          Rectangle r = e.in_rectangle();
          e.filldraw(black, gray);
          r.unfilldraw(black);


[Figure 173. Not displayed.]

Fig. 173.

const function: Rectangle draw_out_rectangle ([const Color& ddraw_color = *Colors::default_color, [string ddashed = "", [string ppen = "", [Picture& picture = current_picture]]]])

Draws the Rectangle that surrounds the Ellipse. The arguments are like those of Path::draw(). The return value is the surrounding Rectangle. See Path Reference; Drawing and Filling.

          Ellipse e(origin, 2.5, 5, 10, 12, 15.5);
          e.shift(-1, 1, 1);
          e.draw_out_rectangle(black, "evenly", "pencircle scaled .3mm");


[Figure 174. Not displayed.]

Fig. 174.

const function: Rectangle draw_in_rectangle ([const Color& ddraw_color = *Colors::default_color, [string ddashed = "", [string ppen = "", [Picture& picture = current_picture]]]])

Draws the Rectangle enclosed within the Ellipse. The arguments are like those of Path::draw(). The return value is the enclosed Rectangle. See Path Reference; Drawing and Filling.

          Ellipse e(origin, 3.5, 6, 10, 12, 15.5);
          e.shift(-1, 1, 1);
          e.draw_in_rectangle(black, "evenly", "pencircle scaled .3mm");


[Figure 175. Not displayed.]

Fig. 175.