public static FRectangle CreateByCenter(FPoint pos, float w, float h) { return(new FRectangle(pos.X - w / 2, pos.Y - h / 2, w, h)); }
public static FRectangle CreateByCenter(FPoint origin, float cx, float cy, float width, float height) { return(new FRectangle(origin.X + cx - width / 2, origin.Y + cy - height / 2, width, height)); }
public static FRectangle CreateByCenter(FPoint pos, FSize size) { return(new FRectangle(pos.X - size.Width / 2, pos.Y - size.Height / 2, size.Width, size.Height)); }
public FRectangle AsCenteredTo(FPoint center) { return(new FRectangle(center.X - Width / 2, center.Y - Height / 2, Width, Height)); }
public FRectangle AsRotateCenterAround(FPoint center, float rot) { return(CreateByCenter(Center.RotateAround(center, rot), Width, Height)); }
public FRectangle AsScaledAndTranslated(float scale, FPoint offset) { return(new FRectangle(X * scale + offset.X, Y * scale + offset.Y, Width * scale, Height * scale)); }
public bool Contains(FPoint p, float delta) { return((X - p.X) * (X - p.X) + (Y - p.Y) * (Y - p.Y) <= (Radius + delta) * (Radius + delta)); }
public bool Contains(FPoint p) { return((X - p.X) * (X - p.X) + (Y - p.Y) * (Y - p.Y) <= Radius * Radius); }
public FCircle(FPoint location, float radius) { X = location.X; Y = location.Y; Radius = radius; }
public static FSize Diff(FPoint a, FPoint b) { return(new FSize(FloatMath.Abs(a.X - b.X), FloatMath.Abs(a.Y - b.Y))); }