18static inline gmPos gmpos(
double x,
double y) {
29static inline void gm_pos_set(
gmPos *p,
double x,
double y) {
38static inline void gm_pos_reset(
gmPos *p) {
48static inline double gm_pos_magniture(
gmPos p) {
58static inline double gm_pos_distance(
gmPos a,
gmPos b) {
72 double ab_x = b.
x - a.
x;
73 double ab_y = b.
y - a.
y;
74 double ac_x = c.
x - a.
x;
75 double ac_y = c.
y - a.
y;
76 return 0.5 *
fabs(ab_x * ac_y - ab_y * ac_x);
double pow(double base, double exp)
Calculates the base raised to the power of the exponent (base^exp).
Definition math.h:358
double fabs(double x)
Calculates the absolute value of a double.
Definition math.h:369
double sqrt(double x)
Calculates the square root of x.
Definition math.h:339
double gm_triangle_area(gmPos a, gmPos b, gmPos c)
Definition position.h:71
Represents a 2D position or vector.
Definition position.h:8
double x
Definition position.h:9
double y
Definition position.h:9