Drawing arrows with the GD library in PHP

While generating schemes for finite state machines with PHP, I missed the possibility to draw arrows with aligned arrowheads using the GD library. The presented class GDArrow draws such arrows in a referenced canvas. The usage is easy:

* $myArrow = new GDArrow()
* $myArrow -> image = foo
* $myArrow -> color = bar
* $myArrow -> x1 = foo
* $myArrow -> y1 = bar
* $myArrow -> x2 = foo
* $myArrow -> y2 = bar
* $myArrow -> angle = foo
* $myArrow -> radius = bar
* $myArrow -> drawGDArrow()

x1y1 is the starting point, x2y2 the endpoint of the arrow, angle is the angle of the arrowheads arm segments to the arrowline, radius the length of these segments.

The class can easily be included, the member variables are public. Download here

The following image was created using the GDArrow class: