Math-Offset vector (or point) by distance and angle

From Vectorlab
Jump to: navigation, search


Offsets a vector by a given distance and angle. Like reshaping a line on drawing modifying its rotation. By Orso B. Schmid


{ Orso ***************************** }
{ translate a point by a distance and an angle }
{ remember that offset with ang=0 means translate horiz to the right }
FUNCTION M_OffsetPt(p : VECTOR; dist, ang: REAL): VECTOR;
	BEGIN
		M_OffsetPt := p + (Ang2Vec(ang, 1) * dist);
	END;