area function

dynamic area(
  1. dynamic p,
  2. dynamic q,
  3. dynamic r
)

Implementation

area(p, q, r) {
  return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
}