The calculation is done by finding a minimum value of a cost
function that is the vector difference between (x
,y
)
and the corresponding values returned by geodXy()
.
See “Caution”.
Usage
geodXyInverse(x, y, longitudeRef, latitudeRef, debug = getOption("oceDebug"))
Arguments
- x
value of x in metres, as given by
geodXy()
- y
value of y in metres, as given by
geodXy()
- longitudeRef
reference longitude, as supplied to
geodXy()
- latitudeRef
reference latitude, as supplied to
geodXy()
- debug
an integer specifying whether debugging information is to be printed during the processing. This is a general parameter that is used by many
oce
functions. Generally, settingdebug=0
turns off the printing, while higher values suggest that more information be printed. If one function calls another, it usually reduces the value ofdebug
first, so that a user can often obtain deeper debugging by specifying higherdebug
values.
Details
The minimum is calculated in C for speed, using the nmmin
function
that is the underpinning for the Nelder-Meade version of the R function
optim()
. If you find odd results, try setting debug=1
and rerunning, to see whether this optimizer is having difficulty
finding a minimum of the mismatch function.