/// <summary> /// /// </summary> static Length() { _factors = new Dictionary<LengthType, double>(); _factors.Add(LengthType.mm, 1d); _factors.Add(LengthType.cm, 10d); _factors.Add(LengthType.dm, 100d); _factors.Add(LengthType.m, 1000d); _factors.Add(LengthType.km, 1000 * 1000d); _allowableDeviation = new Length(0.001, LengthType.mm); }
public Length(Length rhs) : this(rhs._value, rhs._lengthType) { }
/// <summary> /// /// </summary> /// <param name="l1"></param> /// <param name="l2"></param> /// <returns></returns> public static Length operator -(Length l1, Length l2) { double valOfmm = l1.ToMM().Value - l2.ToMM().Value; Length r = new Length(valOfmm, LengthType.mm); return r.ConvertTo(l1.LengthType); }