Rectangle2D

Description

Represents a rectangle and angle of its rotation.

struct Rectangle2D
{
	Point2D origin;
	float angle;
	float width;
	float height;
};

Structure fields and default values (if defined) are described below:

  • Point2D Origin - Defines the top-left corner of the rectangle
  • float Angle - Rotation angle
  • float Width - Horizontal size
  • float Height - Vertical size
struct Rectangle2D
{
	Point2D	Origin;
	float	Angle;
	float	Width;
	float	Height;


	Point2D Origin( void ) const	{ return Origin;	};
	float Angle( void ) const		{ return Angle;		};
	float Width( void ) const		{ return Width;		};
	float Height( void ) const		{ return Height;	};

	bool operator == ( const avl::Rectangle2D& rhs ) const
	{
		return Origin == rhs.Origin && 
			Angle == rhs.Angle && 
			Width == rhs.Width && 
			Height == rhs.Height;
	}

	bool operator != ( const avl::Rectangle2D& rhs ) const
	{
		return !(operator==(rhs));
	}

};