It works in Linux (Ubuntu 9.10) with Wine.
Quote: |
Why does it not work directly without Wine? |
At least in C++ that would be more work to decompile. It may be easier for someone to port the Vincenty code from Fortran to C++ than try to hack an .exe.
At least in C++ that would be more work to decompile. It may be easier for someone to port the Vincenty code from Fortran to C++ than try to hack an .exe.
function destVincenty(lat1, lon1, brng, dist) { var a = 6378137, b = 6356752.3142, f = 1/298.257223563; // WGS-84 ellipsiod var s = dist; var alpha1 = brng.toRad(); var sinAlpha1 = Math.sin(alpha1); var cosAlpha1 = Math.cos(alpha1); var tanU1 = (1-f) * Math.tan(lat1.toRad()); var cosU1 = 1 / Math.sqrt((1 + tanU1*tanU1)), sinU1 = tanU1*cosU1; var sigma1 = Math.atan2(tanU1, cosAlpha1); var sinAlpha = cosU1 * sinAlpha1; var cosSqAlpha = 1 - sinAlpha*sinAlpha; var uSq = cosSqAlpha * (a*a - b*b) / (b*b); var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq))); var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq))); var sigma = s / (b*A), sigmaP = 2*Math.PI; while (Math.abs(sigma-sigmaP) > 1e-12) { var cos2SigmaM = Math.cos(2*sigma1 + sigma); var sinSigma = Math.sin(sigma); var cosSigma = Math.cos(sigma); var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM))); sigmaP = sigma; sigma = s / (b*A) + deltaSigma; } var tmp = sinU1*sinSigma - cosU1*cosSigma*cosAlpha1; var lat2 = Math.atan2(sinU1*cosSigma + cosU1*sinSigma*cosAlpha1, (1-f)*Math.sqrt(sinAlpha*sinAlpha + tmp*tmp)); var lambda = Math.atan2(sinSigma*sinAlpha1, cosU1*cosSigma - sinU1*sinSigma*cosAlpha1); var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha)); var L = lambda - (1-C) * f * sinAlpha * (sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM))); var revAz = Math.atan2(sinAlpha, -tmp); // final bearing return new LatLon(lat2.toDeg(), lon1+L.toDeg()); }
error: call of overloaded ‘abs(double)’ is ambiguous /usr/include/stdlib.h:766: note: candidates are: int abs(int) /home/neil/upp/uppsrc/Core/Core.h:300: note: Upp::int64 abs(Upp::int64) /usr/include/c++/4.4/cstdlib:170: note: long long int __gnu_cxx::abs(long long int) /usr/include/c++/4.4/cstdlib:139: note: long int std::abs(long int) /home/neil/MyApps/Distance/VincFormula.h: In function ‘std::string
Didier wrote on Sat, 20 March 2010 22:29 |
But why not publish a linux version ...? |
error: call of overloaded ‘abs(double)’ is am biguous /usr/include/stdlib.h:766: note: candidates are: int abs(int) /home/neil/upp/uppsrc/Core/Core.h:300: note: Upp::int64 abs(Upp::int64) /usr/include/c++/4.4/cstdlib:170: note: long long int __gnu_cxx::abs(long long int) /usr/include/c++/4.4/cstdlib:139: note: long int std::abs(long int) /home/neil/MyApps/Distance/VincFormula.h: In function ‘std::string
class EditFileFolder : public EditString { typedef EditFileFolder CLASSNAME; protected: bool EditFileFolder::Key(dword key, int rep) { // EditFileFolder:: is useless if (key == K_ENTER) { // Catch the ENTER DoGo(); return false; } else return EditField::Key(key, rep); }
Could not display "/home/neil/Downloads/Distance". There is no application installed for executable files
// if (ic>122 || ch=='°' || ch==''' || ch=='"') ic = 32; if (ic>122 || ic==-80 || ic==39 || ic==34) ic = 32;
nlneilson wrote on Fri, 26 March 2010 13:08 |
TrimBoth(); I will try that. One thing I noticed that seemed odd in upp: The character for the degree symbol ° as int = -80 I thought that should be 176 I am handling it in upp with: // if (ic>122 || ch=='°' || ch==''' || ch=='"') ic = 32; if (ic>122 || ic==-80 || ic==39 || ic==34) ic = 32; That could have something to do with the problem. Sometimes for ° ic = -62 AND ch = -62 rather than ch = '°' With my code the ° should be replaced with a space. To take care of some strange stuff I have: if (ic < 0) continue; I could change that to: if (ic < 0) ic = 32; and then a few lines of code in C++ to check/remove the consecutive space/s similar to .replaceAll("\\s+", " "); in Java. |
12°34'56"N,12°34'56"W 12° 34' 56" N , 12° 34' 56" W
Quote: |
The character for the degree symbol ° as int = -80 I thought that should be 176 |
Quote: |
It still seems strange the integer representation of any character would be less than 0. |