bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::utils::geom::GenericLine< dim > Class Template Reference

class GenericLine. Represents a generic line with vertex VertexType The equation of a linein l=Ax + By + C More...

#include <generic_line.h>

Inheritance diagram for bitrl::utils::geom::GenericLine< dim >:

Public Types

typedef GeomPoint< dimvertex_type
 

Public Member Functions

 GenericLine ()
 Constructor.
 
 GenericLine (const vertex_type &p1, const vertex_type &p2)
 Constructor.
 
 GenericLine (const vertex_type &p1, const vertex_type &p2, uint_t id)
 Constructor.
 
const vertex_typeget_vertex (uint_t v) const
 Returns the v-th vertex of the segment.
 
vertex_typeget_vertex (uint_t v)
 Returns the v-th vertex of the segment.
 
bool has_valid_id () const noexcept
 Returns true iff id_ != rlenvscpp::consts::INVALID_ID.
 
uint_t get_id () const noexcept
 Returns the id of the line.
 
void set_id (uint_t id) noexcept
 Set the id of the line.
 
real_t slope () const
 The slope of the line.
 
real_t factor () const
 Returns the constant factor.
 
real_t distance (const vertex_type &n) const
 Returns the perpendicular distance from the line to the node.
 
real_t length () const
 Calculate the length of the line.
 
real_t distance (const GenericLine< 2 >::vertex_type &n) const
 

Static Public Attributes

static const int dimension = dim
 

Detailed Description

template<int dim>
class bitrl::utils::geom::GenericLine< dim >

class GenericLine. Represents a generic line with vertex VertexType The equation of a linein l=Ax + By + C

Member Typedef Documentation

◆ vertex_type

template<int dim>
typedef GeomPoint<dim> bitrl::utils::geom::GenericLine< dim >::vertex_type

Constructor & Destructor Documentation

◆ GenericLine() [1/3]

template<int dim>
bitrl::utils::geom::GenericLine< dim >::GenericLine ( )

Constructor.

◆ GenericLine() [2/3]

template<int dim>
bitrl::utils::geom::GenericLine< dim >::GenericLine ( const vertex_type p1,
const vertex_type p2 
)

Constructor.

◆ GenericLine() [3/3]

template<int dim>
bitrl::utils::geom::GenericLine< dim >::GenericLine ( const vertex_type p1,
const vertex_type p2,
uint_t  id 
)

Constructor.

Member Function Documentation

◆ distance() [1/2]

◆ distance() [2/2]

template<int dim>
real_t bitrl::utils::geom::GenericLine< dim >::distance ( const vertex_type n) const

Returns the perpendicular distance from the line to the node.

◆ factor()

template<int dim>
real_t bitrl::utils::geom::GenericLine< dim >::factor ( ) const

Returns the constant factor.

◆ get_id()

template<int dim>
uint_t bitrl::utils::geom::GenericLine< dim >::get_id ( ) const
inlinenoexcept

Returns the id of the line.

◆ get_vertex() [1/2]

template<int dim>
GenericLine< dim >::vertex_type & bitrl::utils::geom::GenericLine< dim >::get_vertex ( uint_t  v)

Returns the v-th vertex of the segment.

◆ get_vertex() [2/2]

template<int dim>
const GenericLine< dim >::vertex_type & bitrl::utils::geom::GenericLine< dim >::get_vertex ( uint_t  v) const

Returns the v-th vertex of the segment.

◆ has_valid_id()

template<int dim>
bool bitrl::utils::geom::GenericLine< dim >::has_valid_id ( ) const
inlinenoexcept

Returns true iff id_ != rlenvscpp::consts::INVALID_ID.

◆ length()

template<int dim>
real_t bitrl::utils::geom::GenericLine< dim >::length ( ) const
inline

Calculate the length of the line.

◆ set_id()

template<int dim>
void bitrl::utils::geom::GenericLine< dim >::set_id ( uint_t  id)
inlinenoexcept

Set the id of the line.

◆ slope()

template<int dim>
real_t bitrl::utils::geom::GenericLine< dim >::slope ( ) const

The slope of the line.

Member Data Documentation

◆ dimension

template<int dim>
const int bitrl::utils::geom::GenericLine< dim >::dimension = dim
static

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