I Need a math guru
I'll take a stab... looks like the question isn't one of geometry, but
rather of layout. Let's have a1,b1 be the location of the starting point
(15, 16 in your second example) and a2,b2 the location of the ending point
(2,1). It looks to me as if you have to consider which dimension has the
furthest to move. In making that move, you have the OPTION to move up to as
far in the other dimension. So in c1, calculate the number of steps in the
major dimension as =max(abs(a1-a2),abs(b1-b2). In c2, the steps in the minor
dimension is =min(abs(a1-a2),abs(b1-b2)). The total steps in c3 is
=c1+max(0,c2-int(c1/2)). It seems to work for the examples you offered, but
I'd test a little further... If it's not quite right, please provide some
counterexamples and the correct results.
HTH. --Bruce
"Adam Kroger @hotmail.com" wrote:
The problem, I think, comes from the fact that the map is built on a
hexoganal "grid". The map numbering looks like this
0111 0311
0211 0411
0112 0312
0212 0412
0113 0313
0213 0413
0114 0314
0214 0414
So if a unit is in hex 0114, and another is in 0311, the "hand counted"
distance is 4, but using =SQRT(ABS(A1-A2)^2+ABS(B1-B2)^2) to calculate it
results in 3.61 wich works. However, if I am using map locations 1516 &
0201, the counted distance is 21 but the formula returns 19.85 with does not
work.
The Hexes on the map are 1 5/16" accross (flat to flat) (3/4" on a side)so
if units are 2 hexes away (verticle) their physical distance is just over
2.5" BUT if they are 2 hexes away horizontally the physical distance is only
~2.25" at close ranges, the difference is negligable, but as the range
increases.....
I can almost see the answer, but it is escaping me.
I hope this helps.
Adam
"Niek Otten" wrote in message
...
Hi Adam,
I don't understand what you have and what you're trying to calculate.
If you have two legs, you have three points, haven't you? So you can
calculate the third leg the same way.
Please explain a bit more and give an example
--
Kind regards,
Niek Otten
"Adam Kroger @hotmail.com" <adam_kroger<nospam wrote in message
...
I am trying to develop a formula so that Excel can calculate the range for
a wargame. The game is called Battletech if you know what it is. It is
played on a map that has a hex grid measuring ~3/4" a side. The hexes are
numbered (4 digit 01 - 15 accross and 01 - 17 up top left is numbered 1001
bottom right 1517 The map is 15x17 ) so I am able to give Excel the
position of each unit on the map. and calculate 2 legs of a triangle, but
it is not always a right triangle (I struggled with it for 3 days before I
realized wy a^2+b^2=c^2 wasn't working.... It has been almost 20 years
since I took a geometry class.....
Thanks in advance for any help I can get.
Adam
|