//
// Created by zx on 2020/9/9.
//

#include "pose2d.h"
#include <math.h>
Pose2d::Pose2d()
    :m_x(0),m_y(0),m_theta(0)
{
}
Pose2d::Pose2d(float x,float y,float theta)
    :m_x(x),m_y(y),m_theta(theta)
{
}

Pose2d::~Pose2d()
{}

std::ostream& operator<<(std::ostream &out,const Pose2d& point)
{
    out<<"[x:"<<point.x()<<", y:"<<point.y()<<", theta:"<<point.theta()<<"]";
    return out;
}
float Pose2d::gridient() const
{
    double gradient=tanf(m_theta);
    if(fabs(gradient)>200)
        return 200.0*(gradient/fabs(gradient));
    return gradient;
}