Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Want to win a free rep everyday forever?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
Localhost
I post too much
Reputation: 0

Joined: 28 Apr 2007
Posts: 3402

PostPosted: Fri Jul 03, 2009 9:28 pm    Post subject: Want to win a free rep everyday forever? Reply with quote

Port the following from javascript to C (i may accept C++) NO VB, NO C#

Code:

function distVincenty(lat1, lon1, lat2, lon2) {
  var a = 6378137, b = 6356752.3142,  f = 1/298.257223563;  // WGS-84 ellipsiod
  var L = (lon2-lon1).toRad();
  var U1 = Math.atan((1-f) * Math.tan(lat1.toRad()));
  var U2 = Math.atan((1-f) * Math.tan(lat2.toRad()));
  var sinU1 = Math.sin(U1), cosU1 = Math.cos(U1);
  var sinU2 = Math.sin(U2), cosU2 = Math.cos(U2);
 
  var lambda = L, lambdaP, iterLimit = 100;
  do {
    var sinLambda = Math.sin(lambda), cosLambda = Math.cos(lambda);
    var sinSigma = Math.sqrt((cosU2*sinLambda) * (cosU2*sinLambda) +
      (cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda));
    if (sinSigma==0) return 0;  // co-incident points
    var cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda;
    var sigma = Math.atan2(sinSigma, cosSigma);
    var sinAlpha = cosU1 * cosU2 * sinLambda / sinSigma;
    var cosSqAlpha = 1 - sinAlpha*sinAlpha;
    var cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha;
    if (isNaN(cos2SigmaM)) cos2SigmaM = 0;  // equatorial line: cosSqAlpha=0 (§6)
    var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));
    lambdaP = lambda;
    lambda = L + (1-C) * f * sinAlpha *
      (sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));
  } while (Math.abs(lambda-lambdaP) > 1e-12 && --iterLimit>0);

  if (iterLimit==0) return NaN  // formula failed to converge

  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 deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-
    B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));
  var s = b*A*(sigma-deltaSigma);
 
  s = s.toFixed(3); // round to 1mm precision
  return s;
}

_________________
Back to top
View user's profile Send private message MSN Messenger
Leader of the Revolution
Grandmaster Cheater
Reputation: 6

Joined: 12 Sep 2008
Posts: 724

PostPosted: Fri Jul 03, 2009 9:29 pm    Post subject: Reply with quote

this will probably fuck you over or delete hall.dll if you run it watch out
Back to top
View user's profile Send private message
Localhost
I post too much
Reputation: 0

Joined: 28 Apr 2007
Posts: 3402

PostPosted: Fri Jul 03, 2009 9:31 pm    Post subject: Reply with quote

iFlyHigh wrote:
this will probably fuck you over or delete hall.dll if you run it watch out


Troll.

_________________
Back to top
View user's profile Send private message MSN Messenger
Waly
Master Cheater
Reputation: -1

Joined: 25 Nov 2008
Posts: 293

PostPosted: Fri Jul 03, 2009 9:31 pm    Post subject: Reply with quote

iFlyHigh wrote:
this will probably fuck you over or delete hall.dll if you run it watch out
Get the fuck out.
Nobody likes you.
Back to top
View user's profile Send private message
Localhost
I post too much
Reputation: 0

Joined: 28 Apr 2007
Posts: 3402

PostPosted: Fri Jul 03, 2009 9:32 pm    Post subject: Reply with quote

██&am wrote:
iFlyHigh wrote:
this will probably fuck you over or delete hall.dll if you run it watch out
Get the fuck out.
Nobody likes you.


Help me with this D:

_________________
Back to top
View user's profile Send private message MSN Messenger
Kurifodo
I post too much
Reputation: 23

Joined: 09 Oct 2008
Posts: 2782

PostPosted: Fri Jul 03, 2009 9:33 pm    Post subject: Reply with quote

iFlyHigh wrote:
this will probably fuck you over or delete hall.dll if you run it watch out


fail
Back to top
View user's profile Send private message
Leader of the Revolution
Grandmaster Cheater
Reputation: 6

Joined: 12 Sep 2008
Posts: 724

PostPosted: Fri Jul 03, 2009 9:56 pm    Post subject: Reply with quote

dont you just love trolling
Back to top
View user's profile Send private message
Hitman
Master Cheater
Ban
Reputation: 9

Joined: 21 Sep 2008
Posts: 385
Location: Toronto

PostPosted: Fri Jul 03, 2009 9:57 pm    Post subject: Reply with quote

well duh

if (iterLimit==0) return NaN // formula failed to converge

fixed

if (iterLimit==0) return 9001 // formula win

_________________
Back to top
View user's profile Send private message
Loganator
Master Cheater
Reputation: 4

Joined: 29 Oct 2008
Posts: 472

PostPosted: Fri Jul 03, 2009 9:59 pm    Post subject: Reply with quote

iFlyHigh wrote:
dont you just love trolling

What
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites