# ns3::Rectangle Class Reference

a 2d rectangle More...

`#include <rectangle.h>`

List of all members.

## Public Member Functions

Rectangle (double _xMin, double _xMax, double _yMin, double _yMax)
Rectangle ()
bool IsInside (const Vector &position) const
Side GetClosestSide (const Vector &position) const
Vector CalculateIntersection (const Vector &current, const Vector &speed) const

a 2d rectangle

## Constructor & Destructor Documentation

 ns3::Rectangle::Rectangle ( double _xMin, double _xMax, double _yMin, double _yMax )

Parameters:
 _xMin x coordinates of left boundary. _xMax x coordinates of right boundary. _yMin y coordinates of bottom boundary. _yMax y coordinates of top boundary.
Create a rectangle.

 ns3::Rectangle::Rectangle ( )

Create a zero-sized rectangle located at coordinates (0.0,0.0)

## Member Function Documentation

 Vector ns3::Rectangle::CalculateIntersection ( const Vector & current, const Vector & speed ) const

Parameters:
 current the current position speed the current speed
Returns:
the intersection point between the rectangle and the current+speed vector.
This method assumes that the current position is located _inside_ the rectangle and checks for this with an assert. This method compares only the x and y coordinates of the input position and speed. It ignores the z coordinate.

 Side ns3::Rectangle::GetClosestSide ( const Vector & position ) const

Parameters:
 position the position to test.
Returns:
the side of the rectangle the input position is closest to.
This method compares only the x and y coordinates of the input position. It ignores the z coordinate.

 bool ns3::Rectangle::IsInside ( const Vector & position ) const

Parameters:
 position the position to test.
Returns:
true if the input position is located within the rectangle, false otherwise.
This method compares only the x and y coordinates of the input position. It ignores the z coordinate.

The documentation for this class was generated from the following file:
• src/mobility/rectangle.h

Generated on Fri Apr 9 15:01:10 2010 for NS-3 by  1.5.8