Calculating 2D positions from a curve? I am with quite a dylema here, as I need this for a game (so I am going to transform the given answers into programming code) to make a polygon around a curved line. from each line segment I have the X and Y positions, not I need to calculate all the X,Y positions around the curve like this:

The black dots are the known XY coordinates and the purple ones are the ones I want to calculate.
Please explain step-by-step how to calculate the XY of each purple point?
The order of the points has to create a polygon, so an calculation in this order would also be nice.
Thanks in advance!
Edit:
The red line IS the bisector of the angle between three black points (or two blue lines)
and the distance between a purple dot and a black dot is 5.0.
Edit: 
I created a program (source code here) thanks to the first answer but there is a little problem:

As you can see the polygon line cross themselves which shouldn't happen...
tomorrow I'm going to try to program answer #2 or wait till answer #1 will be updated.
Thanks to everyone for their time and efford!
Edit:
Created the program from answer #2 and the same problem persists :(
This is the result:

The red dots are the "purple points" on one side and the blue dots are the "purple points" on the other side of the curve, at least they supposed to be.
You can see on the image that the theory is missing something.
But what?
Update:
Here is more user-friendly source code:
pastebin.com/BJss8D5x
and the program itself:
gpb.googlecode.com/files/DRAWER3.zip
Update:
if anyone wants the updated code, here it is:
http://pastebin.com/WqQEnpma
 A: First, define a couple of functions on points $(x,y)$
$$
u((x,y))=\frac{(x,y)}{\sqrt{x^2+y^2}}\tag{1}
$$
$u$ untizes $(x,y)$, and
$$
r((x,y))=u((y,-x))\tag{2}
$$
$r$ unitizes and rotates $(x,y)$ by $90^\circ$.
Given three consecutive black points, $\{p_{k-1},p_k,p_{k+1}\}$, the two purple points on either side of $p_k$ would be
$$
p_k\pm5.0\,r(u(p_{k+1}-p_k)-u(p_{k-1}-p_k))\tag{3}
$$
For the endpoints or for points where $u(p_{k+1}-p_k)=u(p_{k-1}-p_k)$, then the two purple points are either
$$
p_k\pm5.0\,r(p_{k+1}-p_k)\tag{4}
$$
or
$$
p_k\pm5.0\,r(p_{k-1}-p_k)\tag{5}
$$
Use $(4)$ when there is no $p_{k-1}$, or $(5)$ when there is no $p_{k+1}$, or either one when both $p_{k-1}$ and $p_{k+1}$ exist, but $u(p_{k+1}-p_k)=u(p_{k-1}-p_k)$.

Let me compute the purple points of the lower left corner of the path.
Digitizing the image gives these points
$$
\begin{align}
p_{k-1}&=(355.669,371.368)\\
p_k&=(54.677,370.827)\\
p_{k+1}&=(205.173,296.12)
\end{align}
$$
with $17.0$ as the distance from black to purple point.
Then
$$
\begin{align}
u(p_{k-1}-p_k)&=(0.999998,0.001797)\\
u(p_{k+1}-p_k)&=(0.895711,-0.444636)\\
r(u(p_{k+1}-p_k)-u(p_{k-1}-p_k))&=(-0.973784,0.227476)\\
p_k+17.0\,r(\dots)&=(38.123,374.694)\\
p_k-17.0\,r(\dots)&=(71.231,366.96)
\end{align}
$$
Here is where the purple points should go:
$\hspace{2cm}$
