Point given Angle and Distance

Plotting relative point at Angle and Distance

This method is useful for plotting a relative point in 2D space, given a start point, an angle and the desired distance.

View example

You might use this method for having a character fire along a specific path, or plot a relative movement.

The method is as follows:

function pointAtAngleDistance(x, y, deg, dist)
	return [(dist * Math.cos(deg)) + x,
		(dist * Math.sin(deg)) + y];

Page loaded in 0.009 second(s).