Click to See Complete Forum and Search --> : Here's a little something to think about
NotLKH
Mar 13th, 2004, 05:52 PM
Attached you'll see 4 different hexagonal layouts. See if you can develop conversion methods to intertranslate between each.
Of course, the Family Map doesn't have enough information to translate directly to the other three, so assume you know the index of the sector that the individual Family cell is in.
You don't have to make a 1 to 1 translation for each possability, you can daisy chain to translate, ie...
If you have a translation from Cell to Ring_Sector_Offset,
And a Translation from Ring_Sector_Offset to Family,
And a Translation from Family with Sector to Cell, then
that is more than enough. All you'd have to then do is get XYZ to one of those three, and any one of those three to XYZ, and you'd be able to go from 1 to all of them.
Now, the conversions from XYZ to Ring_Sector_Offset might be the hardest to do, so be creative in your strategies.
I'll post my solutions in a few days, so...
-Have Fun
-Lou
:wave:
http://www.vbforums.com/attachment.php?s=&postid=1647467
twanvl
Mar 14th, 2004, 10:18 AM
I found a solution with the following conversions:
RSO -> Family
RSO -> Cell
Cell -> RSO
RSO -> XYZ
XYZ -> RSO
I'll post it as an attachment instead of in this post, so if you want to solve it yourself, don't look at it.
NotLKH
Mar 14th, 2004, 11:56 AM
Ok. A quick glance shows me you picked up on some key points.
I'll start looking at it momentarily.
But, first a Bonus Question:
Since the subject is Hexagonal Mapping conventions, I dredged something up from my distant Commadore & Qbasic days, {when I created a program to build a standard Ace of Aces set of books from the mathematical hexagonal methods I managed to harvest from analysis of an Ace of Aces Baloon Buster set of books that I had. Phew, not only i,j,k but each cell had a rotation orientation! Plus I had to translate {i,j,k,rotation} to linear! And that mid-page manuever, ingenious! I'll have to redevelop it again someday.}. See if you can make translation equations to go from XYZ to the following IJK mapping.
BTW, The I,J,K mapping just tells you how to get from the XYZ origin to any of the other cells in the XYZ map, where i = (0,1,-1). j = (-1,0,1) and k = (1, -1, 0)
Now you could get from the origin to any XYZ cell in many infinite possible ways of first travelling p units of i, then q units of j, and then r units of k, so the "hard" part is determining the shortest path of {i,j,k} to get to xyz from 000.
-Have Fun
-Lou
http://www.vbforums.com/attachment.php?s=&postid=1647756
hmmm, gonna have to scale down that pict a bit. eh, I guess maybe later.
twanvl
Mar 14th, 2004, 01:17 PM
So, given a coordinate (x,y,z) you want to find the corresponding (a,b,c) so that ai+bj+ck = (x,y,z)
The algorithm I propose to find (a,b,c) is simple:
Repeat until (x,y,z) = (0,0,0):
If y>0 and z<0 then
let a = a + 1
let (x,y,z) = (x,y,z) - i
Same thing for +i,-j,+j,-k,+k
In (x,y,z) notation, the following is always the case: x+y+z = 0
Because of that, there will always be one of x,y,z>0 and another <0, unless all of them are 0. That means that thiss loop will always do something. It will make |x|+|y|+|z| 2 smaller, the number >0 is decreased, the number <0 is increased. This continues until x=y=z=0, so this loop will terminate.
To show that this algorithm provides the correct answer I propose the following invariant:
ai + bj + ck + (x,y,z)new=(x,y,z)original
This is not hard to see, look for example at the step:
let a = a + 1
let (x,y,z) = (x,y,z) - i
So:
anewi + (x,y,z)new = (aprevious+1)i + (x,y,z)previous - i
anewi + (x,y,z)new = apreviousi + (x,y,z)previous
Well, this is not really an 'equation'...
NotLKH
Mar 14th, 2004, 01:28 PM
Ok. I see you've been busy.
Attached You'll find my text response to your {twanvl's} text response.
However, let me first display the Family Numbers when you go from ring 1 to ring 5
Matrix of Fam Number in relation to Ring and Offset:
- 01 02 03 04 05 ...Ring
0 01 02 04 07 11
1 -- 03 05 08 12
2 -- -- 06 09 13
3 -- -- -- 10 14
4 -- -- -- -- 15
5
.
.
.
off
hmmm, my tables messed up a hair. oh well, its understandable anyways! Got It! I'll add some zeroes.
As you can see, Family Numbers are Triangular, and not based on 2^n.
I'll check into your IJK in a little bit. I gotta go now.
-Lou
NotLKH
Mar 14th, 2004, 01:50 PM
OOPS!
As my alter ego would say:
wahn moe ting!
I forgot to add this in my response to your observation of the relation between the ring of rso and the values of xyz:
There is a simple relationship between r and the values of x,y,z which require no analysis between x and y and z.
It hinges on "inverting" your observation of x + y + z = 0
-Nuff said.
-Lou
:wave:
NotLKH
Mar 14th, 2004, 02:16 PM
Hmmm, sure is lively around here.
I'd really love to see any suggestions for alternate hexagonal mapping schemes.
So far we have:
Cell
XYZ
Ring, Sector, Offset
I,J,K
Family with Sector
And if any would like to see the simple relationship between XYZ and mapping the centers of each Hexagonal cell to a true 2d Plane, let me know.
BTW, you'll find an interesting relationship between a cube and a Hexagonal Structure if you map XYZ 3d.
Or even furthur, if you map consistantly any 2 of the three XYZ coords to a square.
{hmmm, I wonder what it'd look like if rso or ijk was mapped 3d.}
;)
-Lou
twanvl
Mar 14th, 2004, 03:10 PM
You could also make a (x,1/2 i) mapping (combining the x axis, and the i axis scaled) That would look something like this. This mapping is like a square (maybe you should use the rotated, (z, 1/2 k) mapping).
http://www.vbforums.com/attachment.php?s=&postid=1647855
NotLKH
Mar 14th, 2004, 03:20 PM
Throw in a Radical 3 { or is it a Rad(3)/2? ehhh, I'll check later} multiplier and you've mapped the cells center points 2d. Good Job!
;)
-Lou
puzzled
Although, I fail to see the relationship between the i of ijk, and your referance to 1/2 i.
Its more of a mapping of (x, y-z) as far as I see.
:)
NotLKH
Mar 14th, 2004, 09:14 PM
BTW, All this is a precurser to the grand {opening? exposure? revalation? Papa Can you hear me???...} of "Why One?".
But, thats besides the point.
ATM. {At the Moment}
So. Wahn Moe Ting.
If you specify a row whose constant value is m, {either m = x, y, or z, depending on your momentary mood}, if n = one of the other coords, and p = the remaining coord, in an xyz mapping,:
What is the min and max value that n range? {And, verse vica, p???} ?
-Lou
BTBTW: 2 More days until a higher authority recieves "Why One?"
I hope I hope I hope he sees some merit!!!
-Lou
NotLKH
Mar 14th, 2004, 09:55 PM
And, since I'm in the mood, attached is my VB code to go from:
RSO->XYZ
XYZ->RSO
XYX->IJK
and an illustration of":
IJK->XYZ
So, if you can do better, let us know!
-Lou
sql_lall
Mar 15th, 2004, 03:53 AM
Sorry, i just had to say something:
1: "There is a simple relationship between r and the values of x,y,z which require no analysis between x and y and z. It hinges on "inverting" your observation of x + y + z = 0"
well, R (if R means row) = (|x|+|y|+|z|)/2
Anyway, what i wanted to say was:
if you can map P->Q, and Q->R, you can map P->R.
e.g. twanvl said he/she could map
RSO -> Family
RSO -> Cell
Cell -> RSO
RSO -> XYZ
XYZ -> RSO
So they can also map:
Cell -> XYZ (through RSO)
XYZ -> Cell (through RSO)
and i'm not sure, cos i haven't tried yet, but wouldn't it be not too hard to map P->Q if you can already map Q->P?
NotLKH
Mar 15th, 2004, 05:40 AM
Originally posted by sql_lall
Sorry, i just had to say something:
1: "There is a simple relationship between r and the values of x,y,z which require no analysis between x and y and z. It hinges on "inverting" your observation of x + y + z = 0"
well, R (if R means row) = (|x|+|y|+|z|)/2
Exactly!
:)
Originally posted by sql_lall
Anyway, what i wanted to say was:
if you can map P->Q, and Q->R, you can map P->R.
yep! thats what I meant when I said:
you don't have to make a 1 to 1 translation for each possibility, you can daisy chain to translate
So. SQL_Lall. Why don't you try XYZ to RSO?
:wave:
twanvl
Mar 15th, 2004, 07:55 AM
Hi, I just tought of another mapping scheme. This one has some fractal like properties, which you will probably not enjoy when thinking of a conversion :)
I define it as a mapping to (i,j,k) coordinates:
F(0) = (0,0,0)
F(4n) = -2 F(n)
F(4n+1) = -2 F(n) + i
F(4n+2) = -2 F(n) + j
F(4n+2) = -2 F(n) + k
Every cell should now have a single, unique number (proof?). The numbering will look something like this:
http://www.vbforums.com/attachment.php?s=&postid=1648249
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.