roboplayer.geometry
Class Rectangle

java.lang.Object
  |
  +--roboplayer.geometry.Rectangle

public class Rectangle
extends java.lang.Object

Helper class for different rectangle functions.

Version:
1.0
Author:
Krzysztof Langner

Constructor Summary
Rectangle()
          Empty constructor
Rectangle(double x1, double y1, double x2, double y2)
          constructor
 
Method Summary
 Vector2d getCenter()
          return center of the rectangle
 boolean isIn(Vector2d pos)
          check if given point is inside rectangle
 java.lang.String toString()
          Convert to string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rectangle

public Rectangle()
Empty constructor


Rectangle

public Rectangle(double x1,
                 double y1,
                 double x2,
                 double y2)
constructor

Parameters:
x1 - left
y1 - top
x2 - right
y2 - bottom
Method Detail

isIn

public boolean isIn(Vector2d pos)
check if given point is inside rectangle

Parameters:
pos - point position
Returns:
true if point is inside rectangle

getCenter

public Vector2d getCenter()
return center of the rectangle

Returns:
center point of the rectangle

toString

public java.lang.String toString()
Convert to string

Overrides:
toString in class java.lang.Object
Returns:
object converted to string