# How to convert Distance, Azimuth, Dip to XYZ?

I have an excel spreadsheet with header and survey drill data. Header data contains hole ID, and location coordinates, and the survey data contains related downhole survey with Distance, Azimuth and Dip values.

Since I know the hole location and surface elevation, I would like to be able to convert the survey table to XYZ coordinates as well. Does anyone has a function / procedure / example? (VB & ArcObjects) Survey Data: • Couldn't you just use them as xyz coordinates anyways? I assume that dip has an origin of 0, doesn't it? – Emily Aug 11 '11 at 19:17
• @Emily - Yes the first XYZ is given (X:425990,Y:5409010,Z:350). The dip value is 0 and the distance is 0. How do I calculate the XYZ for Distance:41, Azimuth: 359, Dip: -71? (At each survey point the direction and inclination will be different, resulting deviated and spiraling downholes) There is probably a simple formula... – Jakub Sisak GeoGraphics Aug 11 '11 at 19:44

The question asks for conversion between spherical and cartesian coordinates. This spreadsheet lays out the formulas: Blue lines are input, black are intermediate calculations, and red are output. Within the formulas, the values are referred to by the names in the [Parameter] column (assigned via the Insert|Name|Create operation).

They differ from those in most math/physics references because in geography, the azimuth is usually taken east of north rather than north of east. This makes the geographic azimuth the complement of the mathematical one (they sum to 90 degrees). Replacing an angle by its complement in any trig function interchanges it with its "co" partner: sine and cosine are interchanged, tangent and cotangent, secant and cosecant. Also, in many mathematical systems the "dip" is expressed as an angle from true vertical (a co-latitude) rather than as an angle from horizontal (a latitude), again causing an interchange of sine and cosine.

### Edit 9/20/13

For a downhole distance you probably want to negate `dZ`.

• Thanks. Looks good! Will have to confirm the azimuth type. How do I find the Radians in the formula? – Jakub Sisak GeoGraphics Aug 11 '11 at 20:19
• Radians = Degrees / 180 * Pi – whuber Aug 11 '11 at 20:20
• Right on. Thanks. I was staring at the formula in the link above and scratching my head. Clear as a bell now. – Jakub Sisak GeoGraphics Aug 11 '11 at 20:37
• @Jakub You are aware that this is a working, valid spreadsheet, right? You can type these formulas into Excel, name the cells in the [Value] column as indicated in the [Parameter] column to its left, and it will run. Blue text is input; black is intermediate calculations; and red is output. Once you're comfortable with it you can modify your second spreadsheet to do the computations for every entry. The only trick is in joining the (X0,Y0,Z0) coordinates from the first: do it with a database or by means of VLOOKUP(). – whuber Aug 11 '11 at 20:41
• I wasn't aware. Even better! So RADIANS is obviously an Excel function to which I am passing either Azimuth or dip. – Jakub Sisak GeoGraphics Aug 11 '11 at 20:52

While this is an old question, the other answers are not appropriate. Converting Distance (Measured Depth), Dip (Inclination), Azimuth to 3D coordinates depends on how you interpret what is happening between the locations where measurements were taken (survey stations). The standard practice today is "Minimum Curvature" where the assumption is that a circular arc connects each survey location.

http://www.drillingformulas.com/minimum-curvature-method/ gives full details on how to calculate the X, Y and Z locations. The relevant portions are:

``````dMD = Distance2 - Distance1
B = acos(cos(I2 - I1) - (sin(I1)*sin(I2)*(1-cos(A2-A1))))
RF = 2 / B * tan(B / 2)
dX = dMD/2 * (sin(I1)*sin(A1) + sin(I2)*sin(A2))*RF
dY = dMD/2 * (sin(I1)*cos(A1) + sin(I2)*cos(A2))*RF
dZ = dMD/2 * (cos(I1) + cos(I2))*RF

X2 = X1 + dX
Y2 = Y1 + dX
Z2 = Z1 + dX
``````
• I found that if there's a straight segment (I1 == I2 and A1 == A2), then B ends up 0 and so RF produces a divide by zero error. In the case that B is zero, then I set RF to 1 (as the limit of RF as B goes to 0 is 1). Otherwise, this works great, thanks! – Saxon Druce Sep 3 '15 at 0:49