Esempio n. 1
0
        public bool Equals(EdPoint b)
        {
            // Compare (x,y) values
            if (this.X == b.X && this.Y == b.Y)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public static BitString Encode(EdPoint point, int b)
        {
            var encoding = new BitString(point.Y, b);

            var xBit = new BitString(point.X, b).GetLeastSignificantBits(1);

            var bytes = new byte[b / 8];

            bytes[0] = 1 << 7;
            if (xBit.Equals(BitString.One()))
            {
                encoding = encoding.OR(new BitString(bytes));
            }
            else
            {
                encoding = encoding.AND(new BitString(bytes).NOT());
            }

            return(BitString.ReverseByteOrder(encoding));      // switch to little endian
        }