private int distance (LuaCallFrame callFrame, int nArguments) {
        double a = LuaState.fromDouble(callFrame.get(0));
        String b = (String)callFrame.get(1);
        double dist = ZonePoint.convertDistanceFrom(a, b);
        callFrame.push(LuaState.toDouble(dist));
        return 1;
    }
Fake Distance constructor

Called from Lua code: d = Wherigo.Distance(number, unit),
converts 'number' from specified unit to metres and returns
that as a double.
main/src/main/java/cgeo/geocaching/wherigo/openwig/WherigoLib.java