A subclass of Shape that represents a Circle in 2D space.
More...
#include <circle.h>
A subclass of Shape that represents a Circle in 2D space.
◆ Circle()
Circle::Circle |
( |
const Vector2 & |
center, |
|
|
const cs225::HSLAPixel & |
color, |
|
|
int |
radius |
|
) |
| |
Constructs a new Circle with the given center, color, and radius.
- Parameters
-
◆ area()
int Circle::area |
( |
| ) |
const |
|
virtual |
Computes and returns the area of the Circle in pixels.
- Returns
- the area of the Circle in pixels
Implements Shape.
◆ contains()
bool Circle::contains |
( |
const Vector2 & |
p | ) |
const |
|
virtual |
Checks to see if the given point is inside the Circle.
- Parameters
-
- Returns
- true if p is inside the Circle
Implements Shape.
◆ draw()
void Circle::draw |
( |
cs225::PNG * |
canvas | ) |
const |
|
virtual |
◆ perimeter()
int Circle::perimeter |
( |
| ) |
const |
|
virtual |
Computes and returns the perimeter of the Circle in pixels.
- Returns
- the perimeter of the Circle in pixels
Implements Shape.
◆ radius()
int Circle::radius |
( |
| ) |
const |
Gets the radius of the Circle in pixels.
- Returns
- the radius of the Circle in pixels
◆ set_radius()
void Circle::set_radius |
( |
int |
radius | ) |
|
Sets the radius of the Circle in pixels.
- Parameters
-
radius | the new radius of the Circle in pixels |
The documentation for this class was generated from the following files: