Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Distance Between Bases as the B29 Flies

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> War in the Pacific: Admiral's Edition >> Distance Between Bases as the B29 Flies Page: [1]
Login
Message << Older Topic   Newer Topic >>
Distance Between Bases as the B29 Flies - 1/20/2016 5:08:05 PM   
Uhionk

 

Posts: 32
Joined: 11/19/2015
Status: offline
Hi,

Does anyone happen to know how to calculate the distance between two bases based on the (x,y) location information?

< Message edited by Uhionk -- 1/20/2016 8:02:18 PM >
Post #: 1
RE: Distance Between Bases and the B29 Flies - 1/20/2016 5:11:07 PM   
Oberst_Klink

 

Posts: 4778
Joined: 2/10/2008
From: Germany
Status: offline
quote:

ORIGINAL: Uhionk

Hi,

Does anyone happen to know how to calculate the distance between two bases based on the (x,y) location information?

Always ask zee Oberst :)

http://www.calculatorsoup.com/calculators/geometry-plane/distance-two-points.php

Klink, Oberst

< Message edited by Oberst_Klink -- 1/20/2016 6:11:46 PM >


_____________________________

My Blog & on Twitter.
Visit CS Legion on Twitter & Facebook for updates.

(in reply to Uhionk)
Post #: 2
RE: Distance Between Bases and the B29 Flies - 1/20/2016 5:28:53 PM   
fcharton

 

Posts: 1112
Joined: 10/4/2010
From: France
Status: offline
If dx and dy are the horizontal and vertical distance, it should be something like

abs(dy)+max(0,abs(dx)-(abs(dy)+1)/2)

where abs is the absolute value, and rounding down any division result.

In your example, dx=164-29=135, dy=112-48=64, and the distance is 64+(135-64/2)=64+103=167

Francois



< Message edited by fcharton -- 1/20/2016 6:48:24 PM >

(in reply to Oberst_Klink)
Post #: 3
RE: Distance Between Bases and the B29 Flies - 1/20/2016 5:39:53 PM   
Uhionk

 

Posts: 32
Joined: 11/19/2015
Status: offline
I did try looking at similar formula, but they don't seem to match.

Johnson Isle (164, 112)
Colombo (29, 48)

Formula Distance: 149
Actual: 167

(in reply to Uhionk)
Post #: 4
RE: Distance Between Bases and the B29 Flies - 1/20/2016 5:53:41 PM   
Oberst_Klink

 

Posts: 4778
Joined: 2/10/2008
From: Germany
Status: offline

quote:

ORIGINAL: Uhionk

I did try looking at similar formula, but they don't seem to match.

Johnson Isle (164, 112)
Colombo (29, 48)

Formula Distance: 149
Actual: 167

francois got it...

no flaw in the formula i got though... just the distance calculation in an x/y coordinate system.

klink, oberst

_____________________________

My Blog & on Twitter.
Visit CS Legion on Twitter & Facebook for updates.

(in reply to Uhionk)
Post #: 5
RE: Distance Between Bases and the B29 Flies - 1/20/2016 5:58:11 PM   
Jorge_Stanbury


Posts: 4320
Joined: 2/29/2012
From: Toronto and Lima
Status: offline
the way I do it is simply to setup an air squadron on any kind of mission, transport, bombing, recon etc.
then set destination on the target and it a message will appear that "X hexes is too far away"

of course that means that I need to have a squadron on the origin hex


< Message edited by Jorge_Stanbury -- 1/20/2016 6:58:42 PM >

(in reply to Oberst_Klink)
Post #: 6
RE: Distance Between Bases and the B29 Flies - 1/20/2016 6:18:30 PM   
Uhionk

 

Posts: 32
Joined: 11/19/2015
Status: offline
Francois method worked with a slight clarification. The dx and dy are not the horizontal and vertical difference.

dx is the smaller of (Loc1x-Loc2x) or (Loc1y-Loc2y) as a positive integer
dy is the larger of the same

Jorge, no need to set a mission, simply clicking on base1 and mouseover base2 shows the distance.

Thanks everyone for the help.


(in reply to Jorge_Stanbury)
Post #: 7
RE: Distance Between Bases and the B29 Flies - 1/20/2016 6:33:46 PM   
Jorge_Stanbury


Posts: 4320
Joined: 2/29/2012
From: Toronto and Lima
Status: offline
Funny I have been playing this since 2012... never realized how easy was to get ranges
thanks

< Message edited by Jorge_Stanbury -- 1/20/2016 7:34:04 PM >

(in reply to Uhionk)
Post #: 8
RE: Distance Between Bases and the B29 Flies - 1/20/2016 6:57:50 PM   
witpqs


Posts: 26087
Joined: 10/4/2004
From: Argleton
Status: offline

quote:

ORIGINAL: Jorge_Stanbury

Funny I have been playing this since 2012... never realized how easy was to get ranges
thanks

Yet another UI improvement that Michael added!

_____________________________


(in reply to Jorge_Stanbury)
Post #: 9
RE: Distance Between Bases and the B29 Flies - 1/20/2016 8:03:43 PM   
Lokasenna


Posts: 9297
Joined: 3/3/2012
From: Iowan in MD/DC
Status: offline

quote:

ORIGINAL: Uhionk

Francois method worked with a slight clarification. The dx and dy are not the horizontal and vertical difference.

dx is the smaller of (Loc1x-Loc2x) or (Loc1y-Loc2y) as a positive integer
dy is the larger of the same

Jorge, no need to set a mission, simply clicking on base1 and mouseover base2 shows the distance.


Thanks everyone for the help.




This. Use this. It works for any selected hex to any other thing that you can mouse-over.

The x,y coordinate system distance-between function is fine and all... but does it actually apply to an x,y system that uses hexes? I haven't checked. I just use the mouse-over feature.

(in reply to Uhionk)
Post #: 10
RE: Distance Between Bases and the B29 Flies - 6/16/2020 10:17:19 AM   
EricTaylor

 

Posts: 1
Joined: 6/16/2020
Status: offline
Mathematically, if you want to determine the distance between two points on a coordinate plane, you use the distance formula. d = √(x2 - x1)^2 + (y2 - y1)^2. When you know the coordinates of the two points that you're trying to find the distance between, just substitute them into the equation.

(in reply to Lokasenna)
Post #: 11
RE: Distance Between Bases and the B29 Flies - 6/16/2020 2:46:44 PM   
Ian R

 

Posts: 3420
Joined: 8/1/2000
From: Cammeraygal Country
Status: offline

quote:

ORIGINAL: EricTaylor

Mathematically, if you want to determine the distance between two points on a coordinate plane, you use the distance formula. d = √(x2 - x1)^2 + (y2 - y1)^2. When you know the coordinates of the two points that you're trying to find the distance between, just substitute them into the equation.


Luckily, we have the mouse-over instead of ...is that Pythagoras?

_____________________________

"I am Alfred"

(in reply to EricTaylor)
Post #: 12
RE: Distance Between Bases and the B29 Flies - 6/16/2020 3:36:36 PM   
geofflambert


Posts: 14863
Joined: 12/23/2010
From: St. Louis
Status: offline

quote:

ORIGINAL: Ian R


quote:

ORIGINAL: EricTaylor

Mathematically, if you want to determine the distance between two points on a coordinate plane, you use the distance formula. d = √(x2 - x1)^2 + (y2 - y1)^2. When you know the coordinates of the two points that you're trying to find the distance between, just substitute them into the equation.


Luckily, we have the mouse-over instead of ...is that Pythagoras?

Looks like lawyerese. divorce alimony = the difference between the total incomes of the first two exes minus the value of the last gift card (a square meal at Applebee's) you gave your future ex plus twice my fee why you ask? Why not?

_____________________________



(in reply to Ian R)
Post #: 13
RE: Distance Between Bases and the B29 Flies - 6/16/2020 6:00:23 PM   
alimentary

 

Posts: 142
Joined: 3/22/2010
Status: offline
quote:

ORIGINAL: Ian R
quote:

ORIGINAL: EricTaylor
Mathematically, if you want to determine the distance between two points on a coordinate plane, you use the distance formula. d = √(x2 - x1)^2 + (y2 - y1)^2.

Luckily, we have the mouse-over instead of ...is that Pythagoras?

That is indeed the Pythagorean theorem. As Ian R tried to say, it applies if you have cartesian coordinates on a Euclidean plane.

The real pacific ocean is not a plane. AE pretends that it is. However, the really sticky bit is that AE is played on a hex grid. The coordinates look like they are Cartesian. But the AE space is not described by the Euclidean metric. It is more of a "taxicab metric" but adapted to a hex grid.

AE distances are the number of moves from hex to adjacent hex that it would take to get from hex A to hex B.

The hexes are lined up in horizontal rows. Each row has a Y coordinate. The rows are stacked with odd numbered rows half a hex farther east than even-numbered rows. This fact really throws a monkey wrench into everything unless you adopt a simple fix:

Before sticking your numbers into the formula, increment the X coordinate on all odd numbered rows by 0.5.

Now then, for generally north/south paths, the distance along the path is how many rows you've moved. Generally north/south paths are identified by the fact that the change in the X coordinate is less than or equal to half the change in Y coordinate:

So:

If |delta X| <= 0.5 * |delta Y| then distance = |delta Y|

For generally east-west paths, the distance along the path is the the change in X coordinate plus 1/2 of the change in Y coordinate.

If |delta X| >= 0.5 * |delta Y| then distance = |delta X| + 0.5 * |delta Y|

Round fractions down.

[On the diagonals where delta Y is half of delta X, both formulas naturally yield the same result]


Let's try this out on the Johnston Isle to Colombo run. (164,112) => (29,48).
Both of those are in even row numbers. So we have no X offset.
Delta X = 164 - 29 = 135
Delta Y = 112 - 48 = 64
Delta X is greater than half of Delta Y so this is a generally east-west path.
135 + 64/2 = 135 + 32 = 167

Bingo!

< Message edited by alimentary -- 6/16/2020 6:56:40 PM >

(in reply to Ian R)
Post #: 14
RE: Distance Between Bases and the B29 Flies - 6/16/2020 6:28:47 PM   
BBfanboy


Posts: 18046
Joined: 8/4/2010
From: Winnipeg, MB
Status: offline

quote:

ORIGINAL: Lokasenna


quote:

ORIGINAL: Uhionk

Francois method worked with a slight clarification. The dx and dy are not the horizontal and vertical difference.

dx is the smaller of (Loc1x-Loc2x) or (Loc1y-Loc2y) as a positive integer
dy is the larger of the same

Jorge, no need to set a mission, simply clicking on base1 and mouseover base2 shows the distance.


Thanks everyone for the help.




This. Use this. It works for any selected hex to any other thing that you can mouse-over.

The x,y coordinate system distance-between function is fine and all... but does it actually apply to an x,y system that uses hexes? I haven't checked. I just use the mouse-over feature.

That works "as-the-Nell-flys" but for ships you have to go around things sometimes. Just set a TF to go from origin to target hex and it will give the hex count for the actual navigation path in the endurance figures at the top left area of the TF screen.

_____________________________

No matter how bad a situation is, you can always make it worse. - Chris Hadfield : An Astronaut's Guide To Life On Earth

(in reply to Lokasenna)
Post #: 15
RE: Distance Between Bases and the B29 Flies - 6/16/2020 7:05:24 PM   
RangerJoe


Posts: 13450
Joined: 11/16/2015
From: My Mother, although my Father had some small part.
Status: offline

quote:

ORIGINAL: BBfanboy


quote:

ORIGINAL: Lokasenna


quote:

ORIGINAL: Uhionk

Francois method worked with a slight clarification. The dx and dy are not the horizontal and vertical difference.

dx is the smaller of (Loc1x-Loc2x) or (Loc1y-Loc2y) as a positive integer
dy is the larger of the same

Jorge, no need to set a mission, simply clicking on base1 and mouseover base2 shows the distance.


Thanks everyone for the help.




This. Use this. It works for any selected hex to any other thing that you can mouse-over.

The x,y coordinate system distance-between function is fine and all... but does it actually apply to an x,y system that uses hexes? I haven't checked. I just use the mouse-over feature.

That works "as-the-Nell-flys" but for ships you have to go around things sometimes. Just set a TF to go from origin to target hex and it will give the hex count for the actual navigation path in the endurance figures at the top left area of the TF screen.


Planes may also want to avoid places where there are fighters as well as radar coverage, not to mention the mark I eyeball. Then who wants to fly into a thunderstorms with tons of explosives?

Also, that formula only works if the starting point and the destination are at the same relative place in their respective hexes.

_____________________________

Seek peace but keep your gun handy.

I'm not a complete idiot, some parts are missing!

“Illegitemus non carborundum est (“Don’t let the bastards grind you down”).”
― Julia Child


(in reply to BBfanboy)
Post #: 16
RE: Distance Between Bases and the B29 Flies - 6/16/2020 7:25:55 PM   
alimentary

 

Posts: 142
Joined: 3/22/2010
Status: offline
quote:

ORIGINAL: RangerJoe
Planes may also want to avoid places where there are fighters as well as radar coverage, not to mention the mark I eyeball. Then who wants to fly into a thunderstorms with tons of explosives?

Also, that formula only works if the starting point and the destination are at the same relative place in their respective hexes.

In the abstraction that is AE, the notions of in-transit interception, radar coverage and thunderstorms are not contemplated. You only get detection and interception at the target hex. The transit is abstracted.

Nor are the locations of the target or of the origin airfield within their respective hexes tracked.

(in reply to RangerJoe)
Post #: 17
RE: Distance Between Bases and the B29 Flies - 6/17/2020 6:41:25 AM   
Chris21wen

 

Posts: 6249
Joined: 1/17/2002
From: Cottesmore, Rutland
Status: offline

quote:

ORIGINAL: Ian R


quote:

ORIGINAL: EricTaylor

Mathematically, if you want to determine the distance between two points on a coordinate plane, you use the distance formula. d = √(x2 - x1)^2 + (y2 - y1)^2. When you know the coordinates of the two points that you're trying to find the distance between, just substitute them into the equation.


Luckily, we have the mouse-over instead of ...is that Pythagoras?


Yes. I real life it's not a simple as that. It works for a flat, two dimentioanl map but not a spherical, three dimentianal one. E.g a globe. Don't ask me what the maths are for that though.

(in reply to Ian R)
Post #: 18
RE: Distance Between Bases and the B29 Flies - 6/23/2020 4:27:24 PM   
alimentary

 

Posts: 142
Joined: 3/22/2010
Status: offline
quote:

ORIGINAL: Chris21wen
Yes. I real life it's not a simple as that. It works for a flat, two dimentioanl map but not a spherical, three dimentianal one. E.g a globe. Don't ask me what the maths are for that though.

If one assumes that the shape of the geoid is a perfect sphere then there is a simple technique that will suffice.

Start by thinking longitude, latitude and the radius of the earth as polar coordinates. Convert them to cartesian coordinates.

x = r * cos(latitude) * sin(longitude)
y = r * cos(latitude) * cos(longitude)
z = r * sin(latitude)

Now compute the straight line (as the tunnel burrows) distance (dt) from the one point to the other.

dt = sqrt( (x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2 )

Now understand that the distance as the tunnel burrows is a chord on a circular segment and the distance as the sea-skimmer skims (ds) is the length of the circular arc.

If we bisect that circular segment we get a right triangle A, B, C with A at one endpoint, B in the middle of the chord and C at the center of the earth. The angle at B is the right angle.

The sine of the angle at C is given by half the chord divided by the Earth's radius. So the full angle is given by

full angle = 2 * asin ( dt / 2r )

If we are working in radians we can read off the sea-skimming distance ds as:

ds = full angle * r

If we are working in degrees we will need to multiply by pi/180

ds = full angle * r * pi/180


If one were actually implementing such a formula there is some simplification that can be done. There is no point in multiplying by r to get the cartesian coordinates and then dividing the computed displacement by r to get the argument for the asin function.

Writing down a complete formula is then a simple but somewhat tedious exercise.

< Message edited by alimentary -- 6/23/2020 4:30:01 PM >

(in reply to Chris21wen)
Post #: 19
RE: Distance Between Bases and the B29 Flies - 6/23/2020 5:45:47 PM   
Ambassador

 

Posts: 1674
Joined: 1/11/2008
From: Brussels, Belgium
Status: offline

quote:

ORIGINAL: BBfanboy


quote:

ORIGINAL: Lokasenna


quote:

ORIGINAL: Uhionk

Francois method worked with a slight clarification. The dx and dy are not the horizontal and vertical difference.

dx is the smaller of (Loc1x-Loc2x) or (Loc1y-Loc2y) as a positive integer
dy is the larger of the same

Jorge, no need to set a mission, simply clicking on base1 and mouseover base2 shows the distance.


Thanks everyone for the help.




This. Use this. It works for any selected hex to any other thing that you can mouse-over.

The x,y coordinate system distance-between function is fine and all... but does it actually apply to an x,y system that uses hexes? I haven't checked. I just use the mouse-over feature.

That works "as-the-Nell-flys" but for ships you have to go around things sometimes. Just set a TF to go from origin to target hex and it will give the hex count for the actual navigation path in the endurance figures at the top left area of the TF screen.

You can also do it from anywhere, even without ships at the origin hex, by using a TF and using waypoints.

(in reply to BBfanboy)
Post #: 20
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> War in the Pacific: Admiral's Edition >> Distance Between Bases as the B29 Flies Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.719