Пример #1
0
        /// <summary>
        /// Moves this by a tiny random amount.
        /// </summary>
        public void RandomPerturb()
        {
            C2DPoint pt     = BoundingRect.GetPointFurthestFromOrigin();
            var      dMinEq = Math.Max(pt.x, pt.y) * Constants.conEqualityTolerance;
            var      rn     = new CRandomNumber(dMinEq * 10, dMinEq * 100);

            var cVector = new C2DVector(rn.Get(), rn.Get());

            if (rn.GetBool())
            {
                cVector.i = -cVector.i;
            }
            if (rn.GetBool())
            {
                cVector.j = -cVector.j;
            }
            Move(cVector);
        }