示例#1
0
 public double Distance(Float2 b)
 {
     return(Math.Sqrt(DistanceSquared(b)));
 }
示例#2
0
 public static V <double> ToVector(this Float2 p)
 {
     return(new V <double>(new double[] { p.X, p.Y }));
 }
示例#3
0
 public static Float2 Max(Float2 a, Float2 b)
 {
     return(new Float2(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)));
 }
示例#4
0
 public double DistanceSquared(Float2 b)
 {
     return((this - b).LengthSquared);
 }
示例#5
0
 public double Dot(Float2 a)
 {
     return(X * a.X + Y * a.Y);
 }
示例#6
0
 public RotatedFloatRect(double cx, double cy, double sx, double sy, double angleRadians)
 {
     center     = new Float2(cx, cy);
     size       = new Float2(sx, sy);
     this.angle = angleRadians;
 }
示例#7
0
 public RotatedFloatRect(FloatRect rect, double angle = 0)
 {
     center     = rect.Center;
     size       = rect.Size;
     this.angle = angle;
 }
示例#8
0
 public RotatedFloatRect(Float2 center, Float2 size, double angleRadians)
 {
     this.center = center;
     this.size   = size;
     this.angle  = angleRadians;
 }
示例#9
0
 public RotatedFloatRect Offset(Float2 offset)
 {
     return(new RotatedFloatRect(center + offset, size, angle));
 }