示例#1
0
        /// <summary>
        /// Initialises an angle as the signed difference between two directions in the 2D plane.
        /// The returned value is the smallest negative angle from one direction to the other.
        /// </summary>
        public static Angle BetweenNegative(Direction2 from, Direction2 to)
        {
            var a = Angle.Between(from, to);

            if (a.radians > 0)
            {
                a -= Mathf.TwoPi.Radians();
            }
            return(a);
        }
示例#2
0
 /// <summary>
 /// Initialises an angle as the signed difference between two directions in the 2D plane.
 /// The returned value is the smallest possible angle from one direction to the other.
 /// </summary>
 public static Angle Between(Direction2 from, Direction2 to)
 {
     return(to - from);
 }