Node:Circles Getstart, Previous:Ellipses Getstart, Up:Plane Figures



Circles

Circles are constructed just like Ellipses, except that the vertical and horizontal axes are per definition the same, so there's only one argument for the diameter, instead of two for the horizontal and vertical axes:

     Point P(0, 2, 1);
     Circle c(P, 3.5, 90, 90);
     c.draw();
     


[Figure 35. Not displayed.]

Fig. 35.

This constructor, too, has a corresponding setting function:

     Circle c;
     Point p(-1, 0, 5);
     for (int i = 0; i < 16; ++i)
       {
           c.set(p, 5, i * 22.5, 0, 0, 64);
           c.draw();
       }
     


[Figure 36. Not displayed.]

Fig. 36.

In the preceding example, the last argument to set(), namely "64", is for the number of Points used for constructing the perimeter of the Circle. The default value is 16, however, if it is used, foreshortening distorts the most nearly horizontal Circle. Increasing the number of points used improves its appearance. However, there may be a limit to how much improvement is possible. See Accuracy.