Gama C Library
Gama C API Documentation
position.h File Reference
#include "_math.h"

Go to the source code of this file.

Data Structures

struct  gmPos
 Represents a 2D position or vector. More...

Functions

double gm_triangle_area (gmPos a, gmPos b, gmPos c)

Function Documentation

◆ gm_triangle_area()

double gm_triangle_area ( gmPos a,
gmPos b,
gmPos c )

Calculate the area of a triangle formed by 3 2D points using the cross product formula

Parameters
aFirst vertex of the triangle
bSecond vertex of the triangle
cThird vertex of the triangle
Returns
The area of the triangle (always positive)