bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
imu_heading::RoundedRectangle Class Reference

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].

Detailed Description

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.

Constructor & Destructor Documentation

◆ RoundedRectangle()

bitsim::trajectory::RoundedRectangle::RoundedRectangle ( real_t half_length,
real_t half_width,
real_t corner_radius )
Parameters
half_lengthHalf the length along x, to the line [m]
half_widthHalf the width along y [m]
corner_radiusThe radius of the corners [m], at most the smaller half side

Member Function Documentation

◆ corner_radius()

◆ distance()

The distance from (x, y) to the track [m], from inside or outside.

◆ half_length()

◆ half_width()

◆ perimeter()

The length of the track [m].

◆ signed_distance()

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.


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