Exemple #1
0
 public double Distance(Float2 b)
 {
     return(Math.Sqrt(DistanceSquared(b)));
 }
Exemple #2
0
 public static V <double> ToVector(this Float2 p)
 {
     return(new V <double>(new double[] { p.X, p.Y }));
 }
Exemple #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)));
 }
Exemple #4
0
 public double DistanceSquared(Float2 b)
 {
     return((this - b).LengthSquared);
 }
Exemple #5
0
 public double Dot(Float2 a)
 {
     return(X * a.X + Y * a.Y);
 }
Exemple #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;
 }
Exemple #7
0
 public RotatedFloatRect(FloatRect rect, double angle = 0)
 {
     center     = rect.Center;
     size       = rect.Size;
     this.angle = angle;
 }
Exemple #8
0
 public RotatedFloatRect(Float2 center, Float2 size, double angleRadians)
 {
     this.center = center;
     this.size   = size;
     this.angle  = angleRadians;
 }
Exemple #9
0
 public RotatedFloatRect Offset(Float2 offset)
 {
     return(new RotatedFloatRect(center + offset, size, angle));
 }