Draw angled line

Monkey Forums/Monkey Code/Draw angled line

Goodlookinguy(Posted 2013) [#1]
This is a simple function for drawing a line starting from a point and given an angle and length. I needed to just draw a line given these parameters and I saw myself writing the math out by hand, which made me think that a small function like this would be nice.

Function DrawAngledLine:Void( x:Float, y:Float, length:Float, angle:Float )
	angle = 360 - (angle Mod 360.0)
	DrawLine(x, y, x + Cos(angle) * length, y + Sin(angle) * length)
End