class mrpt::math::CAtan2LookUpTable

Overview

A look-up-table (LUT) of atan values for any (x,y) value in a square/rectangular grid of predefined resolution.

See also:

mrpt::math::CAtan2LookUpTableMultiRes, mrpt::obs::CSinCosLookUpTableFor2DScans

#include <mrpt/math/CAtan2LookUpTable.h>

class CAtan2LookUpTable
{
public:
    // construction

    CAtan2LookUpTable();

    CAtan2LookUpTable(
        double xmin,
        double xmax,
        double ymin,
        double ymax,
        double resolution
        );

    // methods

    void resize(
        double xmin,
        double xmax,
        double ymin,
        double ymax,
        double resolution
        );

    bool atan2(double y, double x, double& out_atan2) const;
    bool atan2ByIndex(unsigned int iy, unsigned int ix, double& out_atan2) const;
    double getXMin() const;
    double getXMax() const;
    double getYMin() const;
    double getYMax() const;
    double getResolution() const;
    size_t getSizeX() const;
    size_t getSizeY() const;
};

Methods

bool atan2(double y, double x, double& out_atan2) const

Returns the precomputed value for atan2(y,x).

Returns:

false if out of grid bounds.

bool atan2ByIndex(unsigned int iy, unsigned int ix, double& out_atan2) const

Returns the precomputed value for atan2() of the corresponding cell with indices (ix,iy).

Returns:

false if out of grid bounds.