Not sure if this is any help to anyone, but recently I had to create an arrow head on any free hand drawn line. Had to research some trig to get it working and thought I would she the code.
This is the arrow heads being displayed: -
https://gyazo.com/e574bd6457d369dd89daaeba516b4aee
Here is the code: -
-- oldx is the start position of the line -- DrawWidth is the line width as defined by the user -- DrawColour is a table defined by the user -- DrawHistory is an array of groups which allow for an undo if event.phase == "ended" then local arrowHead -- If the line is being drawn right to left we need to draw the arrow head the other way around if oldx \>= event.x then arrowHead = display.newPolygon( event.x, event.y, {oldx+10+DrawWidth,oldy-(10+DrawWidth),oldx-(10+DrawWidth),oldy,oldx+10+DrawWidth,oldy+10+DrawWidth} ) else arrowHead = display.newPolygon( event.x, event.y, {oldx-(10+DrawWidth),oldy-(10+DrawWidth),oldx+10+DrawWidth,oldy,oldx-(10+DrawWidth),oldy+10+DrawWidth} ) end arrowHead.strokeWidth = 1 arrowHead:setStrokeColor( DrawColour[1],DrawColour[2],DrawColour[3] ) arrowHead.fill = {DrawColour[1],DrawColour[2],DrawColour[3]} local opposite = event.y - oldy local Adjacent = oldx - event.x -- Convert the angle to degrees local angle = math.atan( opposite /Adjacent ) \* 57.295779513 -- Rotate Arrow Head arrowHead.rotation = angle \* -1 DrawHistory[#DrawHistory]:insert(arrowHead) end