Data Structures UFC  1.0.0
Essential Data Structures for C language
Data Structures | Typedefs | Functions
circle.h File Reference

Go to the source code of this file.

Data Structures

struct  Circle
 define a Circle structure Has the fields hidden by struct circle as (Point* center) and (float radius) More...
 

Typedefs

typedef struct Circle Circle
 

Functions

Circlecircle_create (Point *center, float radius)
 allocate a new circle on memory based on its parameters More...
 
void circle_free (Circle *c)
 free memory allocated by the circle c More...
 
void circle_set_center (Circle *c, Point *center)
 Set the circle center. More...
 
void circle_set_radius (Circle *c, float center)
 Set the circle radius. More...
 
void circle_set (Circle *c, Point *center, float radius)
 Set the values of center and radius of structure. More...
 
float circle_get_radius (Circle *c)
 Get the radius of circle c. More...
 
Pointcircle_get_center (Circle *c)
 Get the center of circle c. More...
 
void circle_get (Circle *c, Point *center, float *radius)
 Get the its internal attributes through the pointers passed. More...
 
int circle_point_inside (Circle *c, Point *point)
 Check if the pointer /p point is inside of the circle. More...
 

Typedef Documentation

typedef struct Circle Circle

Function Documentation

Circle* circle_create ( Point center,
float  radius 
)

allocate a new circle on memory based on its parameters

Parameters
center_pointintis the center point of the circle
radiusis the radius of the circle
Returns
the address of the allocated circle
void circle_free ( Circle c)

free memory allocated by the circle c

Parameters
ca pointer to Circle structure
void circle_get ( Circle c,
Point center,
float *  radius 
)

Get the its internal attributes through the pointers passed.

Parameters
[in]cthe desired circle as pointer
[out]centerthe point pointer to save the center of c
[out]radiusthe radius to save the radius of c
Point* circle_get_center ( Circle c)

Get the center of circle c.

Parameters
[in]cthe circle to get the /p center
float circle_get_radius ( Circle c)

Get the radius of circle c.

int circle_point_inside ( Circle c,
Point point 
)

Check if the pointer /p point is inside of the circle.

Parameters
cis the circle to check
pointis the point to check if is inside the /p c
Returns
1 if inside of the circle, otherwise 0
void circle_set ( Circle c,
Point center,
float  radius 
)

Set the values of center and radius of structure.

void circle_set_center ( Circle c,
Point center 
)

Set the circle center.

void circle_set_radius ( Circle c,
float  center 
)

Set the circle radius.