[Math] get third point from an arc constructed by Start point, end point and bulge

3dgeometry

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?

Best Answer

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}$

enter image description here

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.