Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Convert decimal geoloxatilation to cardinal point (x,y)
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
joaomello




PostPosted: Mon Sep 13, 2010 11:13 pm   Post subject: Convert decimal geoloxatilation to cardinal point (x,y)

I did in C# in this way:
public static PointF ConverterCoordenadaParaCartesiana(double latitude, double longitude)
{
double latitude_ = (Math.PI / 2) + (latitude * Math.PI / 180.0);
double longitude_ = (longitude * Math.PI / 180.0);

double x = 6378100 * Math.Cos(longitude_) * Math.Sin(latitude_);
double y = 6378100 * Math.Sin(longitude_) * Math.Sin(latitude_);
double z = 6378100 * Math.Cos(latitude_);

return new PointF(Convert.ToSingle(x), Convert.ToSingle(y));
}

but it's very diferent when I compare to google something like a "group of way points", has a better way?
Sorry about my english..

Mello!
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: