get third point from an arc constructed by Start point, end point and bulge it's been a long time since I have done some basic geometry, but I need to construct an arc from three points: start point, end point, and one other point located on the arc, preferrably the point on the arc that lies half way between P1 (startpoint with coordinates x1, y1 and z1) and P2 (endpoint with coordinates x2, y2 and z2).
What I have is: P1, P2, and something called bulge, which comes from an autocad DXF file, and is defined as follows:
"The bulge is the tangent of one fourth the included angle for an arc segment, made negative if the arc goes clockwise from the start point to the endpoint. A bulge of 0 indicates a straight segment, and a bulge of 1 is a semicircle."
(Source: http://www.autodesk.com/techpubs/autocad/acad2000/dxf/vertex_dxf_06.htm).
So I need a function in C++ or C# or another programming language (or simply the steps required to calculate) that gives me the x3,y3 and z3 coordinates of anotherpoint P3 lying on that arc, preferrably in the middle of the arc 
How can this be done?
 A: For 2D case, you can determine the arc's mid-point $Q$ with the help of the following picture and formula:
$M=(P_1+P_2)/2$ , 
Bulge = $D_1/D_2=tan(Delta/4)$ 
$\vec{MQ}$ is perpendicular to $\vec{P_1P_2}$ 

For 3D case, you cannot uniquely determine the arc from two 3D points and bulge as there will be infinite number of solutions that share the same end points and the same bulge. For example, the green arc in above picture can rotate around the axis $P_1P_2$ by any angle and that still satisfy your input. 
A: 1) Taking the two given arc points we can directly determine the half of the chord length, marked as $D_2$ on the picture. It is equal to the length of the vector $\overline{P_1M}$:
$$
\overline{P_1P_2} = \overline{P2} - \overline{P1}\\
\overline{P_1M} = \overline{P_1P_2} \cdot 0.5\\
D_2 = \vert \overline{P_1M}\vert
$$
Vector startToChordMiddleVec = Vector.subtract( P2, P1 );
double halfChordLength = Vector.length( startToChordMiddleVec ) * 0.5f;

2) Using the bulge factor definition, determine the sagitta of the given arc:
$$
D_1 = \vert b \vert \cdot D_2
$$
double sagittaLength = Math.abs( bulgeFactor ) * halfChordLength;

3) Determine the vector $\overline{MQ}$:
​   3.1) Determine the vector $\overline{{MQ}^*}$ rotating the vector $\overline{P_1M}$ by $90^{\circ}$ degrees counterclockwise or clockwise depending on the sign of the bulge factor value:
$$
\begin{equation}
  sign(b) = 
  \begin{cases}
    -1, & if (b<0) ,\\
     0, & if (b=0) ,\\
    +1, & if (b>0) .
  \end{cases}
\end{equation}
$$
$$
 \theta = {sign(b) \cdot { {\pi} \over {2} } },  \\
({MQ}^*)_x=({P_1M})_x \cdot cos(\theta) - ({P_1M})_y \cdot sin(\theta) \\
({MQ}^*)_y=({P_1M})_x \cdot sin(\theta) + ({P_1M})_y \cdot cos(\theta)
$$
double bulgeSign = Math.signum( bulgeFactor );
Vector chordMiddleToArcMiddleVec = startToChordMiddleVec.rotate( bulgeSign * PI/2 );

​   3.2) Scale the vector $\overline{{MQ}^*}$ to the length of the sagitta:
$$
\overline{({MQ}^*)}_n={\overline{{MQ}^*} \over {\overline{\vert {MQ}^*\vert}}}\\
\overline{MQ}=D_1 \cdot \overline{({MQ}^*)}_n
$$
Vector sagittaNormalizedVec = Vector.normalize( chordMiddleToArcMiddleVec );
Vector sagittaOrientedVec = sagittaNormalizedVec.multiply( sagittaLength );

4) Now, the location of the point $Q$ can be determined:
​   4.1) Determine the vector $\overline{M}$:
$$
\overline{M^*} = \overline{P1} + \overline{P2}\\
\overline{M} =\overline{M^*} \cdot 0.5
$$
Vector M = Vector.add( P1, P2 ).multiply( 0.5 );

​   4.2) Determine the vector $\overline{Q}$:
$$
\overline{Q} = \overline{M} + \overline{MQ}
$$
Vector Q = Vector.add( M, sagittaOrientedVec );

$Q_x$ and $Q_y$ are the coordinates of the point we were looking for.
double Qx = Q.getX();
double Qy = Q.getY();

Also, consider using some relations between the arc parts provided from several sources.
