示例#1
0
 static public ShortRange GetExpanded(this ShortRange item, short value)
 {
     return(new ShortRange(
                item.x1.Min(value),
                item.x2.Max(value)
                ));
 }
示例#2
0
 static public bool IsBoundBetween(this short item, ShortRange range)
 {
     return(item.IsBoundBetween(range.x1, range.x2));
 }
示例#3
0
 static public short BindBetween(this short item, ShortRange range)
 {
     return(item.BindBetween(range.x1, range.x2));
 }
示例#4
0
 static public ShortRange GetFlipped(this ShortRange item)
 {
     return(new ShortRange(item.x2, item.x1));
 }
示例#5
0
 static public ShortVariance GetVariance(this ShortRange item)
 {
     return(new ShortVariance(item.GetCenter(), item.GetRadius()));
 }
示例#6
0
 static public short GetWidth(this ShortRange item)
 {
     return((short)(item.x2 - item.x1));
 }
示例#7
0
 static public short GetRadius(this ShortRange item)
 {
     return((short)(item.GetWidth() / 2));
 }
示例#8
0
 static public short GetCenter(this ShortRange item)
 {
     return((short)((item.x1 + item.x2) / 2));
 }