Thunderbots Project
Loading...
Searching...
No Matches
Ray Class Referencefinal

Public Member Functions

 Ray ()
 
 Ray (const Point &start, const Angle &direction)
 
 Ray (const Point &start, const Vector &direction)
 
const PointgetStart () const
 
const AnglegetDirection () const
 
void setStart (const Point &start)
 
void setDirection (const Angle &direction)
 
void setDirection (const Vector &direction)
 
void rotate (const Angle &angle)
 
Vector toUnitVector () const
 

Constructor & Destructor Documentation

◆ Ray() [1/3]

Ray ( )
explicit

Creates a Ray starting at (0, 0) pointing along the positive x-axis

◆ Ray() [2/3]

Ray ( const Point start,
const Angle direction 
)
explicit

Creates a Ray with a start point and a direction angle

Parameters
startthe start point of Ray
directionthe direction angle of Ray

◆ Ray() [3/3]

Ray ( const Point start,
const Vector direction 
)
explicit

Creates a Ray with a start point and a direction vector

Parameters
startthe start point of Ray
directionthe direction vector of Ray

Member Function Documentation

◆ getDirection()

const Angle & getDirection ( ) const

Returns the direction of this Ray

Returns
the direction of this Ray

◆ getStart()

const Point & getStart ( ) const

Returns the start point of this Ray

Returns
the start point of this Ray

◆ rotate()

void rotate ( const Angle angle)

Rotates this Ray counterclockwise by an angle

Parameters
anglethe angle to rotate the Ray

◆ setDirection() [1/2]

void setDirection ( const Angle direction)

Sets the direction of this Ray with an angle

Parameters
directionthe new direction as an angle

◆ setDirection() [2/2]

void setDirection ( const Vector direction)

Sets the direction of this Ray with a vector

Parameters
directionthe new direction as a vector

◆ setStart()

void setStart ( const Point start)

Sets the start point of this Ray

Parameters
pointthe new start point

◆ toUnitVector()

Vector toUnitVector ( ) const

Returns a unit-magnitude Vector in the direction of the Ray

Returns
a unit-magnitude Vector in the direction of the Ray

The documentation for this class was generated from the following files: