/// <summary> /// Returns true if the interval defined by @this is to the right of the interval defined /// by other and is adjacent, i.e. if other = [b, c] and @this = [c, d]. /// </summary> /// <returns><c>true</c>, if adjacent to the right, <c>false</c> otherwise.</returns> /// <param name="this">Value.</param> /// <param name="other">Other.</param> public static bool RightAdjacent(this Interval <float> @this, Interval <float> other) { if (CrMath.AeqB(@this.LowerBound, other.UpperBound) && @this.LowerBoundType == Closed && other.UpperBoundType == Closed) { return(true); } return(false); }
void Initialize(float xA, float yA, float xB, float yB) { if (CrMath.AeqB(xA, xB)) { throw new EvaluatorDxZeroException(); } if (xA > xB) { throw new EvaluatorXaGreaterThanXbException(); } Xa = xA; Xb = xB; Ya = yA.Clamp01(); Yb = yB.Clamp01(); }
/// <summary> /// Determines whether the specified <see cref="T:Crystal.Utility"/> is equal to the current /// <see cref="T:Crystal.Utility"/>. /// </summary> /// <param name="other">The <see cref="T:Crystal.Utility"/> to compare with the current <see cref="T:Crystal.Utility"/>.</param> /// <returns> /// <c>true</c> if the specified <see cref="T:Crystal.Utility"/> is equal to the current /// <see cref="T:Crystal.Utility"/>; otherwise, <c>false</c>. /// </returns> public bool Equals(Utility other) { return(CrMath.AeqB(Value, other.Value) && CrMath.AeqB(Weight, other.Weight)); }
/// <param name="a">The alpha component.</param> /// <param name="b">The blue component.</param> public static bool operator ==(Utility a, Utility b) { return(CrMath.AeqB(a.Value, b.Value) && CrMath.AeqB(a.Weight, b.Weight)); }