Note: These formulas have been transcribed from EPSG Guidance Note #7-2. Users are encouraged to use that document rather than the text which follows as reference because limitations in the transcription will be avoided.
The method has options for the application of two corrections:
i) point scale factor (psf) is used to scale horizontal offsets to the local scale for the projected CRS, resolved into east and north components (when a conformal map projection is used, psf_E = psf_N): (i) no psf correction is applied, (ii) the point scale factor at the well reference point is applied to the complete wellbore, and (iii) the point scale factor at each point along the wellbore is applied.
ii) depth correction factor (dcf) is used to scale horizontal offsets according to the depth of the point in the wellbore: (i) no dcf correction is applied, or (ii) a dcf correction is applied at each point along the wellbore.
The inputs are:
WRP_E : Easting of the Well Reference Point in the target projected CRS;
WRP_N : Northing of the Well Reference Point in the target projected CRS;
psf flag : 0 for none; 1 for constant at first point; 2 to apply a variable point scale factor;
dcf flag : 0 for none; 2 to apply a variable depth correction factor along the path;
n[] : Array of length num_points containing local northing coordinates, oriented to Grid North of the target projected CRS;
e[] : Array of length num_points containing local easting coordinates, oriented to Grid East of the target projected CRS;
D[] : Array of length num_points containing depths below the Vertical Reference Surface at survey stations down the wellbore.
Care must be taken to convert local easting and northing to the same unit as used by the target projected CRS before applying the following equations.
If psf flag=0 and dcf flag=0 then the target coordinates are computed using a simple 2D translation:
E = WRP_E + e
N = WRP_N + n
If psf flag=1 and dcf flag=0 then the target coordinates are computed using a scaled offset as:
E = WRP_E + e * psf_E
N = WRP_N + n * psf_N
If psf flag=2 and dcf flag=2 then an iterative method is needed to compute the variable point scale factor and depth correction factor along the wellbore. The LMP method is recommended in this situation, but if the GNL method is used then map convergence should also be calculated variable along-hole to reference the local coordinates to grid north.
Output arrays E and N of length num_points are computed as follows:
For i=1:num_points
for psf_E and psf_N, compute_psf(E[i-1], N[i-1])
dcf = R / (R – D[i])
E[i] = E[i-1] + (e[i] – e[i-1]) * psf_E * dcf
N[i] = N[i-1] + (n[i] – n[i-1]) * psf_N * dcf
where for i=1, for the first station: E[0] = WRP_E; N[0] = WRP_N; e[0] = 0; n[0] = 0, and:
compute_psf() is a function that returns the local point scale factors in easting and northing directions at the given location;
R = 6371000 m. Note: Using a constant rather than the ellipsoidal local radii of curvature for the depth correction factors in easting and northing directions at the given location results in an insignificantly small error (e.g., for a lateral of 10 km at 10 km depth the worst case difference is 8 centimetres: 6371/(6371-10)=1.001572 vs. 6340/(6340-10)=1.001580).
Reverse case: to compute (n,e) from given (E,N):
For psf_flag=0 and dcf_flag=0:
n = N – WRP_N
e = E – WRP_E
For psf_flag=1 and dcf_flag=0:
n = (N – WRP_N / psf_N
e = (E – WRP_E) / psf_E
For psf_flag=2 and dcf_flag=2 (additionally requiring D as input):
For i=1:num_points
for psf_E and psf_N, compute_psf(E[i-1], N[i-1])
dcf = R / (R – D[i])
n[i] = n[i-1] + (N[i] – N[i-1]) / (psf_N * dcf_N)
e[i] = e[i-1] + (E[i] – E[i-1]) / (psf_E * dcf_E)
where for the first station i=0 is initialised as in the forward case.