Compare commits
3 Commits
2e40ef2a1b
...
562077a8ad
Author | SHA1 | Date | |
---|---|---|---|
562077a8ad | |||
|
aaba6c095e | ||
|
58bbfc54e8 |
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
vscGetReady.sh
|
||||||
|
*~
|
||||||
|
main
|
||||||
|
test.sh
|
||||||
|
main.c
|
45
Component/Geometric/geometry.h
Normal file
45
Component/Geometric/geometry.h
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
#ifndef CYBERSIGHT_GEOMETRY_H
|
||||||
|
# define CYBERSIGHT_GEOMETRY_H
|
||||||
|
|
||||||
|
# include <Compound/common.h>
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
} Point;
|
||||||
|
|
||||||
|
# define point(x, y) (Point){x, y}
|
||||||
|
|
||||||
|
Point PointUtils_Arithmetic(Point *inst, Point *value);
|
||||||
|
bool PointUtils_Duplicate(Point *inst, Point *store);
|
||||||
|
bool PointUtils_Displacement(Point *inst, Point *value);
|
||||||
|
bool PointUtils_Equal(Point *inst, Point *other);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
Point a;
|
||||||
|
Point b;
|
||||||
|
} Line;
|
||||||
|
|
||||||
|
# define line(pa, pb) (Line){{pa.x, pa.y}, {pb.x, pb.y}}
|
||||||
|
|
||||||
|
bool LineUtils_FromPoints(Line *inst, Point *pa, Point *pb);
|
||||||
|
bool LineUtils_FromPointAndLength(Line *inst, Point *p, int len);
|
||||||
|
Line LineUtils_Arithmetic(Line *inst, Line *value);
|
||||||
|
bool LineUtils_Duplicate(Line *inst, Line *store);
|
||||||
|
bool LineUtils_Displacement(Line *inst, Line *value);
|
||||||
|
int LineUtils_CalcLength(Line *inst);
|
||||||
|
bool LineUtils_Equal(Line *inst, Line *other);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
Point a;
|
||||||
|
Point b;
|
||||||
|
} Rect;
|
||||||
|
|
||||||
|
# define rect(pa, pb) (Rect){{pa.x, pa.y}, {pb.x, pb.y}}
|
||||||
|
|
||||||
|
bool RectUtils_FromPoints(Rect *inst, Point *pa, Point *pb);
|
||||||
|
bool RectUtils_FromLines(Rect *inst, Line *la, Line *lb);
|
||||||
|
bool RectUtils_FromDiagonal(Rect *inst, Line *diag);
|
||||||
|
bool RectUtils_Equal(Rect *inst, Rect *other);
|
||||||
|
|
||||||
|
#endif /* CYBERSIGHT_GEOMETRY_H */
|
Reference in New Issue
Block a user