Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active February 29, 2024 03:43
Show Gist options
  • Save mcsee/7b491e643c6a3fe6cba647fa29162c5d to your computer and use it in GitHub Desktop.
Save mcsee/7b491e643c6a3fe6cba647fa29162c5d to your computer and use it in GitHub Desktop.
<?
$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