polygon seems a bit harder to implement than analytic curve.

analytic curve is very easy to use for drawing part of a circle

may i suggest that future version of EJS the analytic curve has the same function as polygon " start type and end type"

then EJS can draw a line with an arrow head using  analytic curve.

this is especially useful for drawing angles !