# Time Depth Conversion using a Horizon Polynomial Function

First, derive a third order polynomial function to define the depth of a specific time horizon. A third order polynomial has the following structure where A, B, C, and D are constants.

Depth = A*twt_ms^{^3} + B*twt_ms^{^2} + C*twt_ms + D

**Note: **A third order polynomial is a complex function. It is also possible to calculate depth as a less complex second order polynomial, a first order linear regression, or even a constant value.

In the following example, the depth function has been calculated as a function of horizon time, where h1 is a two-way-time (twt in milliseconds) horizon:

Depth = (-1.024*(h1/2000)^3) + (604.6 *(h1/2000)^2) + (1500 *(h1/2000)) +128.5

**Note: **This depth is a function of a single time horizon and no other variables, it is therefore only valid at the horizon time and is not advised to use for time depth conversions of horizons above or below this event.

## Create a Time Depth Calculation

- In map view, select the
**Operations**tab >**Horizon Maths**operation. - Select the time horizon that the formula references as input for the
**Horizon**field. - Type the equation into the formula box. Mistakes will be highlighted for you to correct.
- Change the output
**Vertical**domain to**TVDSS (m)**. - Click
**Create**to write a new output horizon, or**Add Property**to save the calculation as a property of the input horizon.

If writing a new output horizon, it is recommended to rename it to something more memorable than the default calculation formula.

In map view, select the newly calculated horizon or horizon property; the Z values are TVDSS.

**Note: **This polynomial function describes the relationship between depth and time, other functions might relate velocity to time or depth to velocity. In these other cases, you must adjust the formula slightly to include all 3 variables. Remember the Velocity (m/s) = Depth (m) *2000 / twt (ms).

For example:

If Velocity_{avg} = A*twt_ms^{^3} + B*twt_ms^{^2} + C*twt_ms + D

Then Depth = TwoWayTime / 2000 * (A*twt_ms^{^3} + B*twt_ms^{^2} + C*twt_ms + D)