|
bitsim
Model, simulate, estimate and control robots in C++
|
A closed track in the plane: a rectangle centred on the origin with its sides along x and y, and its corners rounded with quarter circles. More...
#include <rounded_rectangle.h>
Public Member Functions | |
| RoundedRectangle (real_t half_length, real_t half_width, real_t corner_radius) | |
| real_t | half_length () const noexcept |
| real_t | half_width () const noexcept |
| real_t | corner_radius () const noexcept |
| real_t | distance (real_t x, real_t y) const |
| The distance from (x, y) to the track [m], from inside or outside. | |
| real_t | signed_distance (real_t x, real_t y) const |
| The signed distance from (x, y) to the track [m]: negative inside the shape, positive outside. Its gradient is the outward normal of the track, of length 1. | |
| real_t | perimeter () const |
| The length of the track [m]. | |
A closed track in the plane: a rectangle centred on the origin with its sides along x and y, and its corners rounded with quarter circles.
The track is the boundary of the shape, the line a robot follows. With a corner radius of half the width it is a stadium; with a radius of zero, a rectangle.
| bitsim::trajectory::RoundedRectangle::RoundedRectangle | ( | real_t | half_length, |
| real_t | half_width, | ||
| real_t | corner_radius ) |
| half_length | Half the length along x, to the line [m] |
| half_width | Half the width along y [m] |
| corner_radius | The radius of the corners [m], at most the smaller half side |
|
inlinenoexcept |
| real_t bitsim::trajectory::RoundedRectangle::distance | ( | real_t | x, |
| real_t | y ) const |
The distance from (x, y) to the track [m], from inside or outside.
|
inlinenoexcept |
|
inlinenoexcept |
The length of the track [m].
| real_t bitsim::trajectory::RoundedRectangle::signed_distance | ( | real_t | x, |
| real_t | y ) const |
The signed distance from (x, y) to the track [m]: negative inside the shape, positive outside. Its gradient is the outward normal of the track, of length 1.