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