//规范化为指定长度 public void Normalize(int len) { int lenght = (int)(this.Magnitude() / len); if (lenght > 0) { this.x = IntMath.Abs(this.x / lenght); this.y = IntMath.Abs(this.y / lenght); } }
//返回值大于等于零且小于 System.Int32.MaxValue 的随机数 public int Next() { return(IntMath.Abs(rand())); }