Esempio n. 1
0
            public void AddBeacon(ScannerBeacon beacon)
            {
                if (Becons.Contains(beacon))
                {
                    throw new Exception("Becon added twice.");
                }

                if (Scaners.Contains(beacon.Scanner))
                {
                    throw new Exception("Scanner added twice.");
                }

                Becons.Add(beacon);
                Scaners.Add(beacon.Scanner);
            }
Esempio n. 2
0
            public long GetDistance(ScannerBeacon other)
            {
                var sum = Math.Pow(X - other.X, 2) + Math.Pow(Y - other.Y, 2) + Math.Pow(Z - other.Z, 2);

                return((long)Math.Sqrt(sum));
            }