The set function aside, there are also methods available to retrieve the current area or perimeter, and to draw the circle on the screen.
// retrieve area and perimeter
float a = c.area();
float b = c.perimeter();
5// draw a blue circle on the screen
c.draw(BLUE);
// draw the perimeter only
c.draw(BLUE, false);
10
There’s something remarkable about the draw method! It can be used with one as well as with two methods. To see how this is possible, look at the declaration of this method, which can be found at Esenthel Engine ⇒ Math ⇒ Shapes ⇒ Circle:
void draw(C Color & color, Bool fill = true, Int resolution = -1) C;
The first argument is a Color. The second argument is a bool named ‘fill’. You might suspect this means whether or not you desire to draw the circle as a perimeter or an area. And of course you’re right. Only, the argument doesn’t stop there: it has a value assigned ( = true). This is called a default value. If you agree with the default, you don’t have to explicitly pass true as an argument. Only when you don’t agree, you will have to pass false.