Strilanc.Angle.Basis.FromDirectionAndUnits C# (CSharp) Метод

FromDirectionAndUnits() публичный статический Метод

Returns a basis with a zero angle along the given direction, and units that satisfy the given constraints.
public static FromDirectionAndUnits ( Dir origin, double unitsPerTurn, bool isClockwisePositive ) : Basis
origin Dir
unitsPerTurn double
isClockwisePositive bool
Результат Basis
        public static Basis FromDirectionAndUnits(Dir origin, double unitsPerTurn, bool isClockwisePositive)
        {
            if (unitsPerTurn <= 0) throw new ArgumentOutOfRangeException("unitsPerTurn", "unitsPerTurn <= 0");
            if (double.IsNaN(unitsPerTurn)) throw new ArgumentOutOfRangeException("unitsPerTurn", "unitsPerTurn is not a number");
            if (double.IsInfinity(unitsPerTurn)) throw new ArgumentOutOfRangeException("unitsPerTurn", "unitsPerTurn is infinite");
            var sign = isClockwisePositive ? -1 : +1;
            var factor = RadiansPerRotation / unitsPerTurn;
            return new Basis(origin.UnsignedNaturalAngle, sign * factor);
        }