area2 static method

double area2(
  1. Coordinate p1,
  2. Coordinate p2,
  3. Coordinate p3
)

Returns twice the signed area of the triangle p1-p2-p3. The area is positive if the triangle is oriented CCW, and negative if CW.

Implementation

static double area2(Coordinate p1, Coordinate p2, Coordinate p3) {
  return (p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y);
}