Thunderbots Project
Loading...
Searching...
No Matches
AngleSegment Class Reference

#include <angle_segment.h>

Public Member Functions

 AngleSegment (Angle angle_top, Angle angle_bottom)
 
const AnglegetAngleTop () const
 
void setAngleTop (const Angle &angle_top)
 
const AnglegetAngleBottom () const
 
void setAngleBottom (const Angle &angle_bottom)
 
double getDeltaInDegrees () const
 
bool operator== (const AngleSegment &other) const
 
bool operator!= (const AngleSegment &other) const
 
bool operator< (const AngleSegment &other) const
 
bool operator> (const AngleSegment &other) const
 

Detailed Description

NOTE: We use the top angle for all operators. These custom operators allow us to make sorting for calcbestshot more performant.

Constructor & Destructor Documentation

◆ AngleSegment()

AngleSegment ( Angle  angle_top,
Angle  angle_bottom 
)
explicit

Constructs an AngleSegment represented by a top angle and bottom angle

Parameters
angle_topthe most positive angle
angle_bottomthe most negative angle

Member Function Documentation

◆ getAngleBottom()

const Angle & getAngleBottom ( ) const

Gets the bottom (most negative) angle of the angle segment

Returns
the bottom angle of the angle segment

◆ getAngleTop()

const Angle & getAngleTop ( ) const

Gets the top (most positive) angle of the angle segment

Returns
the top angle of the angle segment

◆ getDeltaInDegrees()

double getDeltaInDegrees ( ) const

Gets the abs delta angle in degrees between the two angles that describe this angle segment

Returns
the abs delta angle in degrees between the top and bottom angles

◆ operator!=()

bool operator!= ( const AngleSegment other) const

Compares another AngleSegment's top angle

Parameters
otherthe other AngleSegment to compare to
Returns
true if both AngleSegment's top angles are not equal

◆ operator<()

bool operator< ( const AngleSegment other) const

Compares another AngleSegment's top angle

Parameters
otherthe other AngleSegment to compare to
Returns
true if this top angle is less than the other's top angle

◆ operator==()

bool operator== ( const AngleSegment other) const

Compares another AngleSegment's top angle

Parameters
otherthe other AngleSegment to compare to
Returns
true if both AngleSegment's top angles are equal

◆ operator>()

bool operator> ( const AngleSegment other) const

Compares another AngleSegment's top angle

Parameters
otherthe other AngleSegment to compare to
Returns
true if this top angle is greater than the other's top angle

◆ setAngleBottom()

void setAngleBottom ( const Angle angle_bottom)

Sets the bottom (most negative) angle of the angle segment

Parameters
angle_bottomthe bottom angle of the angle segment

◆ setAngleTop()

void setAngleTop ( const Angle angle_top)

Sets the top (most positive) angle of the angle segment

Parameters
angle_topthe top angle of the angle segment

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