Exemple #1
0
        //constructor
        /// <summary>
        /// VerticalSinusoalMovement, constuctor
        /// </summary>
        /// <param name="minY">Min Y Value</param>
        /// <param name="maxY">Max Y Value</param>
        /// <param name="y">Inital Y Value</param>
        /// <param name="deltaX">Delta X</param>
        /// <param name="period">Period (In Ticks)</param>
        public HorizontalCosusodalMovement(double minY, double maxY, double y, double period, double deltaX) : base(deltaX, 0.0)
        {
            double amplitude = (maxY - minY) / 2;
            double offset    = maxY - amplitude;
            double phase     = Math.Acos((offset - y) / amplitude) + (2 * Math.PI);
            double altered   = 0.2 * Math.PI / period;

            _cosineMovement = new CosineMovement(amplitude, altered, phase, offset);
        }
        //constructor
        /// <summary>
        /// VerticalSinusoalMovement, constuctor
        /// </summary>
        /// <param name="minX">Min X Value</param>
        /// <param name="maxX">Max X Value</param>
        /// <param name="x">Inital X Value</param>
        /// <param name="deltaY">Delta Y</param>
        /// <param name="period">Period (In Ticks)</param>
        public VerticalCosusodalMovement(double minX, double maxX, double x, double period, double deltaY) : base(0.0, deltaY)
        {
            double amplitude = (maxX - minX) / 2;
            double offset    = maxX - amplitude;
            double phase     = Math.Acos((offset - x) / amplitude) + (2 * Math.PI);
            double altered   = 0.2 * Math.PI / period;

            _cosineMovement = new CosineMovement(amplitude, altered, phase, offset);
        }