//* multifile project example - lib.c *

#include "lib.h" #include <math.h> static inline double sqr(double x) { // return(pow(fabs(x),2)); return(x * x); } double Distance_Between_Points(double x1, double y1, double x2, double y2) { return(sqrt(sqr(x2 - x1) + sqr(y2 - y1))); } double Area_of_Triangle(double leg_lenght_a, double leg_lenght_b, double leg_lenght_c) { // Hero's formula for the triangle area double part = 0.5 * (leg_lenght_a + leg_lenght_b + leg_lenght_c); double area = sqrt(part * (part - leg_lenght_a) * (part - leg_lenght_b) * (part - leg_lenght_c)); return(area); }