   Parallel segment at a given distant
  Hi all,I am developing a game in actionscript and now I am facing a problem that is getting me anywhere.I have segment S defined by two points (A , B). Now I need to find two points which , with a given offset,will define the parellel segment S2 to S.any suggestions or pseudo-code to solve this problem?Thanks...   
  I'm assuming this is 2-d...Compute the direction vector for the segment:vector direction = B - A;Compute a normal for the segment:vector2 normal(-direction.y, direction.x); // Or direction.y, -direction.xnormal.normalize();The two segments in question (one to each side of the original segment) can then be computed as follows:vector2 A1 = A - normal * offset;vector2 B1 = B - normal * offset;vector2 A2 = A + normal * offset;vector2 B2 = B + normal * offset;;  Yes, I was talking about 2D, sorry I have not specified it.However, it worked.Thank you.l   