Data Structures UFC  1.0.0
Essential Data Structures for C language
point.h
Go to the documentation of this file.
1 
13 #ifndef POINT_H
14 #define POINT_H
15 
19 struct Point {
20  float x;
21  float y;
22 };
23 
24 
25 typedef struct Point Point;
26 
32 Point* point_create(float x, float y);
33 
38 void point_free(Point *p);
39 
43 void point_set(Point *p, float x, float y);
44 
48 void point_get(Point *p, float *x, float *y);
49 
53 float point_get_y(Point *p);
54 
58 float point_get_x(Point *p);
59 
63 void point_copy(Point *origin, Point *destination);
64 
70 float point_distance(Point *px, Point *py);
71 
72 #endif
float point_distance(Point *px, Point *py)
calculate the euclidean distance between two points
float point_get_x(Point *p)
Get the y value.
void point_get(Point *p, float *x, float *y)
Get the values of p.x and p.y through the pointers *x and *y.
float y
Definition: point.h:21
float x
Definition: point.h:20
void point_set(Point *p, float x, float y)
Set the values of p.x and p.y.
void point_copy(Point *origin, Point *destination)
Copy point origin to destination.
void point_free(Point *p)
free memory for the Point p
struct Point as 2D space pointer.
Definition: point.h:19
float point_get_y(Point *p)
Get the x value.
Point * point_create(float x, float y)
create a new Point and set x an y