>>1195
>>1197
Happy holidays to everyone.
I adjusted my test case to include the latest walking of the tree using calculated values of d.
Review the TestIterateMovementToAABB line below.
It may look like I'm simply subtracting 1 from t each time, but the reality is that the previous d value is being calculated from the current record using the formula:
return ter.d - 2 * (ter.x + ter.n) + 2 * ter.n;
where ter is the current record.
I think that if we can figure out now how to skip multiple records using a factor, we have a workable solution.
βββββββββ
145=5x29
a x b *=(1,5,4) = {1:5:12:7:5:29} = 145;
1 x c =(1,61,6) = {1:61:12:11:1:145} = 145;
aa x bb =(0,288,61) = {0:288:145:120:25:841} = 21025;
1 x cc =(0,10368,73) = {0:10368:145:144:1:21025} = 21025;
(0,1) perfect squares to analyze
aa x bb (0,1) =(0,1,61) = {0:1:7320:120:7200:7442} = 53582400;
1 x cc (0,1) =(0,1,73) = {0:1:10512:144:10368:10658} = 110502144;
TestDCalculationFromC
βββββββ
ccna.d = 10512 compared to 10512 = 0
((ter.c - 1) / 2) * (ter.c + 1) = ((145 - 1) / 2) * (145 + 1)
(ccna.d record match!)
TestIterateMovementToAABB
1) (0,1,72) = {0:1:10224:142:10082:10368} = 104530176
2) (0,1,71) = {0:1:9940:140:9800:10082} = 98803600
3) (0,1,70) = {0:1:9660:138:9522:9800} = 93315600
4) (0,1,69) = {0:1:9384:136:9248:9522} = 88059456
5) (0,1,68) = {0:1:9112:134:8978:9248} = 83028544
6) (0,1,67) = {0:1:8844:132:8712:8978} = 78216336
7) (0,1,66) = {0:1:8580:130:8450:8712} = 73616400
8) (0,1,65) = {0:1:8320:128:8192:8450} = 69222400
9) (0,1,64) = {0:1:8064:126:7938:8192} = 65028096
10) (0,1,63) = {0:1:7812:124:7688:7938} = 61027344
11) (0,1,62) = {0:1:7564:122:7442:7688} = 57214096
12) (0,1,61) = {0:1:7320:120:7200:7442} = 53582400
Matching aabbna record found!
(1 x cc).x - (aa x bb).x = 144 - 120 = 24
sqrt( (1xcc).d - (aaxbb).x ) == (axb).a
sqrt( 145 - 120 ) = 5. (a matches!!!!)