Data Structures UFC  1.0.0
Essential Data Structures for C language
circle.h
Go to the documentation of this file.
1 
13 #ifndef CIRCLE_H
14 #define CIRCLE_H
15 
16 #include "../point/point.h"
17 
23 struct Circle {
25  float radius;
26 };
27 
28 
29 typedef struct Circle Circle;
30 
38 
39 
44 void circle_free(Circle *c);
45 
50 
54 void circle_set_radius(Circle *c, float center);
55 
59 void circle_set(Circle *c, Point *center, float radius);
60 
61 
65 float circle_get_radius(Circle *c);
66 
72 
79 void circle_get(Circle *c, Point *center, float *radius);
80 
87 int circle_point_inside(Circle *c, Point *point);
88 
89 #endif
float radius
Definition: circle.h:25
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.
int circle_point_inside(Circle *c, Point *point)
Check if the pointer /p point is inside of the circle.
void circle_set_center(Circle *c, Point *center)
Set the circle center.
Point * circle_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.
void circle_free(Circle *c)
free memory allocated by the circle c
Circle * circle_create(Point *center, float radius)
allocate a new circle on memory based on its parameters
define a Circle structure Has the fields hidden by struct circle as (Point* center) and (float radius...
Definition: circle.h:23
float circle_get_radius(Circle *c)
Get the radius of circle c.
Point * center
Definition: circle.h:24
struct Point as 2D space pointer.
Definition: point.h:19