Skip to content

Instantly share code, notes, and snippets.

@pgp44
Created April 14, 2019 04:57
Show Gist options
  • Save pgp44/65b6c9f77918dd985d3cc38414d36fbf to your computer and use it in GitHub Desktop.
Save pgp44/65b6c9f77918dd985d3cc38414d36fbf to your computer and use it in GitHub Desktop.
select largest_triangle(p1,p2,p3)
from ( select (0,0)::point_t, (1,1)::point_t, (0,1)::point_t
union select (0,0)::point_t, (2,2)::point_t, (0,2)::point_t
union select (0,0)::point_t, (4,4)::point_t, (0,4)::point_t
union select (0,0)::point_t, (3,3)::point_t, (0,3)::point_t
) triangles(p1,p2,p3)
⇒ ((0,0),(4,4),(0,4),8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment