Data Structures Lerax 1.0.0
Essential Data Structures for C language
Loading...
Searching...
No Matches
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
void circle_free (Circle *c)
 free memory allocated by the circle c
void circle_set_center (Circle *c, Point *center)
 Set the circle center.
void circle_set_radius (Circle *c, float center)
 Set the circle radius.
void circle_set (Circle *c, Point *center, float radius)
 Set the values of center and radius of structure.
float circle_get_radius (Circle *c)
 Get the radius of circle c.
Pointcircle_get_center (Circle *c)
 Get the center of circle c.
void circle_get (Circle *c, Point *center, float *radius)
 Get the its internal attributes through the pointers passed.
int circle_point_inside (Circle *c, Point *point)
 Check if the pointer /p point is inside of the circle.

Typedef Documentation

◆ Circle

typedef struct Circle Circle

Function Documentation

◆ circle_create()

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

◆ circle_free()

void circle_free ( Circle * c)

free memory allocated by the circle c

Parameters
ca 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]cthe desired circle as pointer
[out]centerthe point pointer to save the center of c
[out]radiusthe radius to save the radius of c

◆ circle_get_center()

Point * circle_get_center ( Circle * c)

Get the center of circle c.

Parameters
[in]cthe circle to get the /p center

◆ circle_get_radius()

float circle_get_radius ( Circle * c)

Get the radius of circle c.

◆ circle_point_inside()

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

◆ circle_set()

void circle_set ( Circle * c,
Point * center,
float radius )

Set the values of center and radius of structure.

◆ circle_set_center()

void circle_set_center ( Circle * c,
Point * center )

Set the circle center.

◆ circle_set_radius()

void circle_set_radius ( Circle * c,
float center )

Set the circle radius.