Go to the source code of this file.
|
struct | Circle |
| define a Circle structure Has the fields hidden by struct circle as (Point* center) and (float radius) More...
|
◆ Circle
typedef struct Circle Circle |
◆ circle_create()
Circle * circle_create |
( |
Point * | center, |
|
|
float | radius ) |
allocate a new circle on memory based on its parameters
- Parameters
-
center_pointint | is the center point of the circle |
radius | is the radius of the circle |
- Returns
- the address of the allocated circle
◆ circle_free()
void circle_free |
( |
Circle * | c | ) |
|
free memory allocated by the circle c
- Parameters
-
c | a pointer to Circle structure |
◆ circle_get()
void circle_get |
( |
Circle * | c, |
|
|
Point * | center, |
|
|
float * | radius ) |
Get the its internal attributes through the pointers passed.
- Parameters
-
[in] | c | the desired circle as pointer |
[out] | center | the point pointer to save the center of c |
[out] | radius | the radius to save the radius of c |
◆ circle_get_center()
Get the center of circle c.
- Parameters
-
[in] | c | the circle to get the /p center |
◆ circle_get_radius()
float circle_get_radius |
( |
Circle * | c | ) |
|
Get the radius of circle c.
◆ circle_point_inside()
Check if the pointer /p point is inside of the circle.
- Parameters
-
c | is the circle to check |
point | is the point to check if is inside the /p c |
- Returns
- 1 if inside of the circle, otherwise 0
◆ circle_set()
void circle_set |
( |
Circle * | c, |
|
|
Point * | center, |
|
|
float | radius ) |
Set the values of center and radius of structure.
◆ circle_set_center()
◆ circle_set_radius()
void circle_set_radius |
( |
Circle * | c, |
|
|
float | center ) |