當前位置: 首頁>>代碼示例>>C#>>正文


C# Azimuth.Normalize方法代碼示例

本文整理匯總了C#中Azimuth.Normalize方法的典型用法代碼示例。如果您正苦於以下問題:C# Azimuth.Normalize方法的具體用法?C# Azimuth.Normalize怎麽用?C# Azimuth.Normalize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Azimuth的用法示例。


在下文中一共展示了Azimuth.Normalize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Randomize

        /// <summary>
        /// Randomizes the emulation by changing speed and direction
        /// </summary>
        /// <param name="seed"> The randomizer to use. </param>
        /// <param name="speedLow"> The minimum travel speed. </param>
        /// <param name="speedHigh"> The maximum travel speed. </param>
        /// <param name="bearingStart"> The initial direction of travel. </param>
        /// <param name="bearingArc"> The arc in which random directional changes will occur. </param>
        /// <remarks>
        /// GPS coordinate emulation can be randomized by any number of factors, depending on the emulator type used.
        /// Any emulation can have it's direction and speed randomized within specified tolerances. By default, speed is 
        /// limited to between 0 (low) and 5 (high) meters/second and bearing changes are limited to +/- 45 degrees 
        /// (a 90 degree arc) from North (0) degrees.
        /// </remarks>
        public void Randomize(Random seed, Speed speedLow, Speed speedHigh, Azimuth bearingStart, Azimuth bearingArc)
        {
            // Flag it so the emulation will use random values
            _isRandom = true;

            // Get the randomizer parameters
            _seed = seed;

            // Get the speed variance
            _speedLow = speedLow.ToMetersPerSecond().Value;
            _speedHigh = speedHigh.ToMetersPerSecond().Value;

            // Get the normalized arc values
            _bearingStart = bearingStart.Normalize().DecimalDegrees;
            _bearingArc = bearingArc.Normalize().DecimalDegrees;
        }
開發者ID:chinnisuraj1984,項目名稱:navigational,代碼行數:30,代碼來源:Emulator.cs


注:本文中的Azimuth.Normalize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。