31 #ifndef TRAJECTORY_TRACKER_EIGEN_LINE_H    32 #define TRAJECTORY_TRACKER_EIGEN_LINE_H    41     const Eigen::Vector2d& a,
    42     const Eigen::Vector2d& b,
    43     const Eigen::Vector2d& c)
    46   ret = 2 * (a[0] * b[1] + b[0] * c[1] + c[0] * a[1] -
    47              a[0] * c[1] - b[0] * a[1] - c[0] * b[1]);
    48   ret /= std::sqrt((b - a).squaredNorm() * (b - c).squaredNorm() * (c - a).squaredNorm());
    53 inline float cross2(
const Eigen::Vector2d& a, 
const Eigen::Vector2d& b)
    55   return a[0] * b[1] - a[1] * b[0];
    59     const Eigen::Vector2d& a,
    60     const Eigen::Vector2d& b,
    61     const Eigen::Vector2d& c)
    63   return cross2((b - a), (c - a)) / (b - a).norm();
    70     const Eigen::Vector2d& a,
    71     const Eigen::Vector2d& b,
    72     const Eigen::Vector2d& c)
    74   if ((b - a).
dot(c - a) <= 0)
    75     return -(c - a).norm();
    76   if ((a - b).dot(c - b) <= 0)
    77     return (c - b).norm();
    82     const Eigen::Vector2d& a,
    83     const Eigen::Vector2d& b,
    84     const Eigen::Vector2d& c)
    90     const Eigen::Vector2d& a,
    91     const Eigen::Vector2d& b,
    92     const Eigen::Vector2d& c)
    94   const float r = (b - a).
dot(c - a) / (b - a).squaredNorm();
    95   return b * r + a * (1.0 - r);
    99 #endif  // TRAJECTORY_TRACKER_EIGEN_LINE_H 
doubleAcc dot(const VectorAcc &lhs, const VectorAcc &rhs)
float lineStripDistanceSigned(const Eigen::Vector2d &a, const Eigen::Vector2d &b, const Eigen::Vector2d &c)
float cross2(const Eigen::Vector2d &a, const Eigen::Vector2d &b)
float lineDistance(const Eigen::Vector2d &a, const Eigen::Vector2d &b, const Eigen::Vector2d &c)
float curv3p(const Eigen::Vector2d &a, const Eigen::Vector2d &b, const Eigen::Vector2d &c)
Eigen::Vector2d projection2d(const Eigen::Vector2d &a, const Eigen::Vector2d &b, const Eigen::Vector2d &c)
float lineStripDistance(const Eigen::Vector2d &a, const Eigen::Vector2d &b, const Eigen::Vector2d &c)