# FLAT SURFACE PROJECTION

We have the three dimensional curve layout complete and need to display this data in two dimensions for easier interpretation and use on standard cut sheets.  This will be a little simpler than our three dimensional curve because we will always start with the hole at 0 degrees and move it to the correct position in two dimensions using s=r*theta to calculate the distance.  We will start with the formula below and you can see the derivation on the cylinder intersection page.  Only the x and z components are necessary for this two dimensional representation.

$0<=t<=2\pi$

$x(t) = a * \cos(t) + Offset$

$z(t) = a * \sin(t)+Elevation+a$

We can determine from the top view:

$\sin(\theta)=\frac{x(t)}{b}$

$\theta=\arcsin(\frac{x(t)}{b})$

$s=r*\theta$

$s=b*\arcsin(\frac{x(t)}{b})$

$s=b*\arcsin(\frac{a * \cos(t) + Offset}{b})$

To move the x component to the proper two dimensional position we apply the following calculation.  The Angle measurement should be in radians.

$x(t) = Angle*b+s$

$x(t) = Angle*b+b*\arcsin(\frac{a * \cos(t) + Offset}{b})$

The z component will be the same as derived on the cylinder intersection page so we have the following equations to plot hole layouts in two dimensions.

$0<=t<=2\pi$

$x(t) = Angle*b+b*\arcsin(\frac{a * \cos(t) + Offset}{b})$

$z(t) = a* \sin(t)+Elevation+a$

Try out the calculations with the following graph hosted on Desmos  https://www.desmos.com/calculator/vcgh6cvthj.