BCH.BCHTool.d2xy C# (CSharp) Method

d2xy() private static method

Decimal Ordinate In to X / Y Coordinate Out
private static d2xy ( uint d, uint &x, uint &y ) : void
d uint Loop integer which will be decoded to X/Y
x uint Output X coordinate
y uint Output Y coordinate
return void
        private static void d2xy(uint d, out uint x, out uint y)
        {
            x = d;
            y = (x >> 1);
            x &= 0x55555555;
            y &= 0x55555555;
            x |= (x >> 1);
            y |= (y >> 1);
            x &= 0x33333333;
            y &= 0x33333333;
            x |= (x >> 2);
            y |= (y >> 2);
            x &= 0x0f0f0f0f;
            y &= 0x0f0f0f0f;
            x |= (x >> 4);
            y |= (y >> 4);
            x &= 0x00ff00ff;
            y &= 0x00ff00ff;
            x |= (x >> 8);
            y |= (y >> 8);
            x &= 0x0000ffff;
            y &= 0x0000ffff;
        }