Computer Science Canada Convert decimal geoloxatilation to cardinal point (x,y) |
Author: | joaomello [ 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! |