Diagonal Beam Lengths not Calculated Correctly

Aug 13, 2015
4
0
1
22
The diagonal lengths on the energy beams don't seem to be calculated correctly. The maximum length of a beam is 16 horizontally, but if you make a structure like so the resultant beam is much longer. Even disregarding the blocks containing the devices on sides A and B (making the triangle 14x15) the resultant hypotenuse beam length, C, is around 20 1/2. Adding on the end blocks equals about 22.
 
Last edited:
Aug 13, 2015
4
0
1
22
Nevermind, it's just the way that Minecraft calculates distances. Diagonals are assumed to be the same length as sides, which is very silly.
 

Ezer'Arch

Administrator
Staff member
May 18, 2013
1,603
446
83
ezerarch.com
Also, which one is more computer intensive?

1)
MaxDistance < sqrt((pt1.x-pt2.x)^2 + (pt1.y-pt2.y)^2)

2)
MaxDistance < (pt1.x-pt2.x) nor (pt1.y-pt2.y)
 
Aug 13, 2015
4
0
1
22
This is true, sqrt operations are rather resource-intensive, so I understand why they are not used, but it doesn't change how silly the assumption that sides and diagonals are the same length is.
 

Ezer'Arch

Administrator
Staff member
May 18, 2013
1,603
446
83
ezerarch.com
but it doesn't change how silly the assumption that sides and diagonals are the same length is.
Now re-reading my post, I think my answer was quite incomplete and a tad blunt, sorry. :S

Say, all the game does is to check if the plane-distance is equal to or greater than MaxDistance, along every axis, disregarding the diagonal distance. Rephrasing: the maximum horizontal (x- and z-axises) and vertical (y-axis) length of a beam is 16. And it has plus: you can climb up and down hills and the beam reflectors don't need to be closer than 16 blocks in order to work, they can be evenly spaced.