Exemplo n.º 1
0
 public BoundingBox2D(IShape2D obj, Point2D topLeft)
 {
     shape = obj;
     TopLeft = topLeft;
     Width = obj.GetWidth();
     Height = obj.GetHeight();
 }
Exemplo n.º 2
0
 public bool Contains(Point2D p)
 {
     float centerX = Left + HorizontalRadius;
     float centerY = Top + VerticalRadius;
     return Math.Pow(p.X - centerX, 2) / Math.Pow(HorizontalRadius, 2) + Math.Pow(p.Y - centerY, 2) / Math.Pow(VerticalRadius, 2) <= 1;
 }
Exemplo n.º 3
0
 public bool ShapeContains(Point2D p)
 {
     return shape.Contains(p);
 }
Exemplo n.º 4
0
 public bool Contains(Point2D p)
 {
     return p.X >= TopLeft.X && p.X <= TopLeft.X + Width
         && p.Y >= TopLeft.Y && p.Y <= TopLeft.Y + Height;
 }