# CIRCLE INTERSECTION

In order to draw arch and elliptical pipe correctly you must calculate the radius intersections given the ASTM measurements.  The measurements given in ASTM C506 for Arch Pipe and C507 for Elliptical pipe do not give intersection points or t Start and t Stop to draw the shapes perfectly and I’ve also found the arcs do not always intersect.  I slightly modify the R3 dimension to force intersection with R1 and R2 so we can evaluate the function.  To properly draw arch and elliptical pipe we need to calculate intersection points of all curves and calculate the t start and t stop for the parametric equation of each curve. Arch Pipe Dimensions Modified to Intersect Equivalent Wall Thickness Rise Span A B C R1 R2 R3 15 2.25 11 18 0.375 4.6875 4.96875 22.875 10.625 4.05 18 2.5 13.5 22 -0.25 6 5.75 27.5 13.75 5.26 24 3 18 28.5 3.4375 5.90625 9.65625 40.6875 14.5625 4.596 30 3.5 22.5 36.25 3.75 7.6875 12.09375 51 18.75 6.032 36 4 26.625 43.375 4.125 8.5625 15.5 62 22.5 6.38 42 4.5 31.3125 51.125 5.0625 10.0625 18 73 26.25 7.57 48 5 36 58.5 6 11.59375 20.5 84 30 8.76 54 5.5 40 65 6.625 13 22.6875 92.5 33.375 9.83 60 6 45 73 7.5 14.6875 25.28125 105 37.5 11.21875 72 7 54 88 9 17 31.4375 126 45 12.5625

This example will calculate the intersection of R1 and R3 for 24″ equivalent arch pipe.

First step is to calculate the variables a,b,c,d.  In the arch pipe diagram above you can see the centroid of the pipe in line with the center of R3 is given point (0,0) and we will calculate the center points of both circles from that point.  Notice capital letters are different variables than lower case variables and are pulled directly from ASTM.

Center R1 =(a,b)= (0,R1-B) = (0,40.6875-5.90625) = (0,34.78125)

Center R3 =(c,d)= (C,0) = (9.65625,0)

Two circles with Radius R1 and R3 can be represented by the equations below:

$R1^2= (x-a)^2+(y-b)^2 \\\ and \\\ R3^2=(x-c)^2+(y-d)^2$

$40.6875^2= (x-0)^2+(y-34.78125)^2 \\\ and \\\ 4.596^2=(x-9.65625)^2+(y-0)^2$

Now we need to calculate the intersection point of the two circles above.

$x1,3=\frac{a+c}{2}+\frac{(c-a)(R1^2-R3^2)}{2D^2}\pm2\frac{b-d}{D^2}\partial$

$y1,3=\frac{b+d}{2}+\frac{(d-b)(R1^2-R3^2)}{2D^2}\pm2\frac{a-c}{D^2}\partial$

$D=\sqrt{(c-a)^2+(d-b)^2}$

$\partial=\frac{1}{4}\sqrt{(D+R1+R3)(D+R1-R3)(D-R1+R3)(-D+R1+R3)}$

$D=\sqrt{(c-a)^2+(d-b)^2}$

$D=\sqrt{(9.65625-0)^2+(0-34.78125)^2}$

$D=36.09679$

Next we need to calculate:

$\partial=\frac{1}{4}\sqrt{(D+R1+R3)(D+R1-R3)(D-R1+R3)(-D+R1+R3)}$

$\partial=\frac{1}{4}\sqrt{(36.09679+40.6875+4.596)(36.09679+40.6875-4.596)(36.09679-40.6875+4.596)(-36.09679+40.6875+4.596)}$

$\partial=4.22564$

Now we can calculate the actual intersection points.

$x1,3=\frac{a+c}{2}+\frac{(c-a)(r1^2-r3^2)}{2D^2}\pm2\frac{b-d}{D^2}\partial$

$x1,3=\frac{0+9.65625}{2}+\frac{(9.65625-0)(40.6875^2-4.596^2)}{2*36.09679^2}+\frac{34.78125-0}{36.09679^2}*4.22564$

$x1,3=11.10972$

$y1,3=\frac{b+d}{2}+\frac{(d-b)(r1^2-r3^2)}{2D^2}\pm2\frac{a-c}{D^2}\partial$

$y1,3=\frac{34.78125+0}{2}+\frac{(0-34.78125)(40.6875^2-4.596^2)}{2*36.09679^2}+\frac{0-9.65625}{36.09679^2}*4.22564$

$y1,3=-4.48538$

R1 and R3 intersect at point (11.10972,-4.48538).

Next we need to calculate the intersection point of R2 and R3.  If we go through the same process we get (14.0918,1.0729).

To draw Radius R3 on the right side of the arch pipe we need to calculate the range of t from the intersection of R1,R3 to R2,R3.

We first calculate tStart using the intersection point of R1 and R3 (11.10972,-4.48538).

$tStart= 2\pi-\arcsin(\frac{-y}{R3})$

$tStart= 2\pi-\arcsin(\frac{-(-4.48538)}{4.596})$

$tStart=4.9322$

We next calculate tStop using the intersection point of R2 and R3 (14.0918,1.0729).

$tStop= \arcsin(\frac{y}{R3})$

$tStop= \arcsin(\frac{1.0729}{4.596})$

$tStop= 0.235608$

With these calculations complete we can draw R3 with our parametric equations derived on the intersecting cylinders page by substituting R3 for the hole radius a as shown below and evaluating over the tStart to tStop+2*pi interval.

$4.9322<=t<=(2*\pi+0.235608)$

$\begin{pmatrix} x(t) \\y(t) \\z(t) \end{pmatrix}=\begin{pmatrix} ((R3 * \cos(t) + Offset)*(cos(360-Angle))) -(\sqrt{b^2-[(R3 * cos(t))+Offset]^2} *sin(360-Angle))\\(R3* \cos(t) + Offset )*sin(360-Angle)+(\sqrt{b^2-[(R3 * cos(t))+Offset]^2}*cos(360-Angle)) \\R3 * \sin(t)+Elevation+\frac{R3}{2} \end{pmatrix}$

After completing this same process for R1 and R2 you have a complete function to draw arch pipe in three dimensions.