Skip to content

Instantly share code, notes, and snippets.

@pgp44
Created April 14, 2019 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgp44/b869c680ad17761f95916d1a5b89cdcb to your computer and use it in GitHub Desktop.
Save pgp44/b869c680ad17761f95916d1a5b89cdcb to your computer and use it in GitHub Desktop.
create function triangle_surface(p1 point_t,p2 point_t,p3 point_t)
returns float
language SQL
as $$
select abs(p1.x*(p2.y-p3.y)+p2.x*(p3.y-p1.y)+p3.x*(p1.y-p2.y))/2
$$;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment