These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

LY Calculation

Author
Biron Soringard
Absurdity of Abstractions
#1 - 2014-01-30 07:23:28 UTC
I've been considering making a simple application as a project to further my programming skills.

One thing I wanted to know before I started off, however: Is there a library or any API functionality that allows me to calculate LY distances between solar systems? I'm assuming there is given that other 3rd party tools do this, but I am not sure where this information can be obtained from.

Thanks
Rob Crowley
State War Academy
#2 - 2014-01-30 08:27:18 UTC
There's no API function for that, the API is almost exclusively used for dynamic (i.e. player-influenced) data. This kind of static data can be found in the SDE. The coordinates of systems are in the mapSolarSystems table or also in mapDenormalize. You can calculate the distances from these coordinates, I don't know if someone made a library for that.
Drailen
Doomheim
#3 - 2014-01-30 08:31:20 UTC
Once you have the co-ordinates of the solar systems, just calculate the Euclidean distance between them.

Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#4 - 2014-01-30 10:12:29 UTC  |  Edited by: Steve Ronuken
Just to be clear:

The X Y Z in mapSolarSystems is the distance from an arbitrary point 0,0,0 (no system exists there) in meters.

So, to calculate the distance between two stars:


sqrt(((X2-X1)^2)+((Y2-Y1)^2)+((Z2-Z1)^2)) (Pythagoras ftw?)

divide it by 9460528450000000 to convert it into light years (ish)

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter