예제 #1
0
 /// <summary>
 /// Expands this interval to include another
 /// </summary>
 /// <param name="other"></param>
 public void Include(Intervalf other)
 {
     if (IsDecreasing)
     {
         IncludeNeg(other.A);
         IncludeNeg(other.B);
     }
     else
     {
         IncludePos(other.A);
         IncludePos(other.B);
     }
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="t"></param>
 /// <param name="from"></param>
 /// <param name="to"></param>
 /// <returns></returns>
 public static float Remap(float t, Intervalf from, Intervalf to)
 {
     return(SlurMath.Remap(t, from.A, from.B, to.A, to.B));
 }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <param name="epsilon"></param>
 /// <returns></returns>
 public bool ApproxEquals(Intervalf other, float epsilon = F.ZeroTolerance)
 {
     return
         (SlurMath.ApproxEquals(A, other.A, epsilon) &&
          SlurMath.ApproxEquals(B, other.B, epsilon));
 }
예제 #4
0
 /// <summary>
 /// Returns the region of a that is not in b.
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <returns></returns>
 public static Intervalf Difference(Intervalf a, Intervalf b)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 /// <summary>
 /// Returns the region of a that is also in b.
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <returns></returns>
 public static Intervalf Intersect(Intervalf a, Intervalf b)
 {
     throw new NotImplementedException();
 }
예제 #6
0
 /// <summary>
 /// Returns the union of a and b.
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <returns></returns>
 public static Intervalf Union(Intervalf a, Intervalf b)
 {
     a.Include(b.A);
     a.Include(b.B);
     return(a);
 }