Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active April 27, 2021 13:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
<?
$triangle = new Polygon([new Point(1, 1), new Point(2, 2), new Point(3, 3)]);
$lastPoint = $triangle->getVertices()->last();
foreach ($triangle->getVertices() as $vertex) {
$canvas->drawLine($vertex, $lastPoint);
$lastPoint = $vertex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment