calculate distance between planets?
Moderators: winston, another_commander
calculate distance between planets?
Hello. I just came upon Oolite yesterday - fantastic fantastic.
I have the Oolite_galaxies spreadsheet. Is it possible to use the X and Y vectors supplied in that spreadsheet to calculate the actual light year distance between two planets in the same galaxy?
Any advice much appreciated
I have the Oolite_galaxies spreadsheet. Is it possible to use the X and Y vectors supplied in that spreadsheet to calculate the actual light year distance between two planets in the same galaxy?
Any advice much appreciated
Last edited by lfnfan on Wed Mar 25, 2009 1:58 pm, edited 1 time in total.
- Disembodied
- Jedi Spam Assassin
- Posts: 6885
- Joined: Thu Jul 12, 2007 10:54 pm
- Location: Carter's Snort
It should be ... although doing so would involve some sort of sum, or similar trick with numbers, I would imagine. Not my strong point!
Of course, the distance as the hyperspatial crow flies isn't necessarily the same thing as the actual distance a player would have to travel, since players can only make hops of up to 7 light years each time.
PS: welcome to the boards!
Of course, the distance as the hyperspatial crow flies isn't necessarily the same thing as the actual distance a player would have to travel, since players can only make hops of up to 7 light years each time.
PS: welcome to the boards!
The chart co-ordinates aren't in light years, so it won't be a simple application of Pythagorus' Theorem if that's what you were hoping.
For example the distance between Qubeen (planet 233) and Soladies (planet 248) is 7.2ly (as seen in the Long Way Around mission). Qubeen is at [132, 243] and Soladies at [112, 252]. By Pythagorus it would be sqrt((132-112)^2 + (243-252)^2)) or something like 22.1 in whatever units the chart co-ords are in.
For example the distance between Qubeen (planet 233) and Soladies (planet 248) is 7.2ly (as seen in the Long Way Around mission). Qubeen is at [132, 243] and Soladies at [112, 252]. By Pythagorus it would be sqrt((132-112)^2 + (243-252)^2)) or something like 22.1 in whatever units the chart co-ords are in.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
thanks for the welcome!
yep - cartesian stylee. I just tried lave to riedquat, which, from what I remember, is about 7 light years (just at the edge of one tank of fuel)
lave 20,273
riedquat 3,181
Carol Vorderman told me the cartesian equation is :
root((x2-x1)^2 + (y2-y1)^2)
which gives: ( 289 + 64 ) ^0.5
which gives: 19
which is not at all near 7.
lave to zaonce on the same basis comes out at 17.5, but it should also be about 7.
Rats. I'm trying to work out some good trading routes, and being able to compute these distances would really help
yep - cartesian stylee. I just tried lave to riedquat, which, from what I remember, is about 7 light years (just at the edge of one tank of fuel)
lave 20,273
riedquat 3,181
Carol Vorderman told me the cartesian equation is :
root((x2-x1)^2 + (y2-y1)^2)
which gives: ( 289 + 64 ) ^0.5
which gives: 19
which is not at all near 7.
lave to zaonce on the same basis comes out at 17.5, but it should also be about 7.
Rats. I'm trying to work out some good trading routes, and being able to compute these distances would really help
I'm not Carol Vorderman. We've just got the same IQ
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Disembodied
- Jedi Spam Assassin
- Posts: 6885
- Joined: Thu Jul 12, 2007 10:54 pm
- Location: Carter's Snort
Anybody tried to see what happens if you use parsecs. I know that in this case it makes it worse, but there are other units used for measureing astronomical distances. AU (Astronomical Unit) is another one. If your 19 distance = 19 "desiparsecs", you would get about 6.2 LY. Just a thought that some other unit might have been used.lfnfan wrote:yep - cartesian stylee. I just tried lave to riedquat, which, from what I remember, is about 7 light years (just at the edge of one tank of fuel)
lave 20,273
riedquat 3,181
Carol Vorderman told me the cartesian equation is :
root((x2-x1)^2 + (y2-y1)^2)
which gives: ( 289 + 64 ) ^0.5
which gives: 19
which is not at all near 7.
lave to zaonce on the same basis comes out at 17.5, but it should also be about 7.
Rats. I'm trying to work out some good trading routes, and being able to compute these distances would really help
Wikipedia:
The parsec ("parallax of one arcsecond", symbol pc) is a unit of length, equal to just under 31 trillion kilometres (about 19 trillion miles), or about 3.26 light-years.
An astronomical unit (abbreviated as AU, au, a.u., or sometimes ua) is a unit of length based on the mean distance from the Earth to the Sun. The precise value of the AU is currently accepted as 149,597,870,691 ± 6 metres[1] (nearly 150 million kilometres or 93 million miles).
And if you look here
http://en.wikipedia.org/wiki/Conversion_of_units#Length you will find a few more unit types for measuring huge distances.
However, if those coordinates are from the original Elite, I suspect that they were chosen, and used because they fit and saved memory and do not represent any unit at all.
"A brilliant game of blasting and trading... Truly a mega-game... The game of a lifetime."
(Gold Medal Award, Zzap!64 May 1985).
(Gold Medal Award, Zzap!64 May 1985).
- Disembodied
- Jedi Spam Assassin
- Posts: 6885
- Joined: Thu Jul 12, 2007 10:54 pm
- Location: Carter's Snort
Could you not just take whatever the game shows the distance as being between Lave and Riedquat (say, 6.8 LY) and divide that by whatever number you get from your calculation (19), giving 0.358 or thereabouts. So – assuming that I understand this, which is by no means a given – if you then multiply all your answers from Carol Vorderman's equations by 0.358, you'll get the answer in light-years. Yes? Or no?
Disembodied, that is exactly what I was thinking!! I will calculate a few more distances when I get back to the game, and see if there is a constant 'x-factor' (shudder)....
Would be neat if that factor also translated into an actual astronomical measure (there seem to be a few to choose from
)
That trading starmap is an awesome piece of work - thanks for pointing it out.
Would be neat if that factor also translated into an actual astronomical measure (there seem to be a few to choose from
)
That trading starmap is an awesome piece of work - thanks for pointing it out.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
I am sure your approach is right. It only needs an appropriate scaling factor.lfnfan wrote:Rats. I'm trying to work out some good trading routes, and being able to compute these distances would really help
Wait.... searching in the code: Hmm. It is a bit different. From the code I read:
Code: Select all
OOINLINE double distanceBetweenPlanetPositions ( int x1, int y1, int x2, int y2)
{
int dx = x1 - x2;
int dy = (y1 - y2)/2;
int dist = sqrtf(dx*dx + dy*dy);
return 0.4 * dist;
}
However, for trading routes you don't need LY but flight time. And flight time in hours is the square of jump distance in LY. This non-linear flight time complicates things. Doing two smaller jumps is much faster in game time than one big jump. (In playing time it is the opposite of cause).
For calculating efficient trading routes you must divide the distance in as much short jumps as you can.
EDIT: And that is what Tomsk wrote above.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Welcome to the board!
Screet
Maybe you should try to get the advanced navigational array and use that one, as it calculates the real routes a player would have to fly from one planet to another, even with any number of jumps in between!lfnfan wrote:Rats. I'm trying to work out some good trading routes, and being able to compute these distances would really help
Screet
wow, thanks for your responses people. that's very cool.
Tomsk and Eric - thanks for the formula and the proof in the code!
Screet - I've already spotted the Advanced Navigational Array - now I just need to start earning some credits!!
Eric - what's the game time consideration with long jumps? I would rather do one long jump than two short ones 'cos it means less chance of ending up on the side of a space station
Tomsk and Eric - thanks for the formula and the proof in the code!
Screet - I've already spotted the Advanced Navigational Array - now I just need to start earning some credits!!
Eric - what's the game time consideration with long jumps? I would rather do one long jump than two short ones 'cos it means less chance of ending up on the side of a space station