searchlocation.cpp
Go to the documentation of this file.
1 #include "searchlocation.h"
2 #include <math.h> // pow() & sqrt()
3 #include <cmath> // abs()
4 
5 SearchLocation::SearchLocation(float _x, float _y, float _theta)
6 {
7  x = _x;
8  y = _y;
9  theta = _theta;
10 }
11 
13 {
14  return std::abs(x - other.x) < sameness_threshold && std::abs(y - other.y) < sameness_threshold;// && abs(theta - other.theta) < sameness_threshold;
15 }
16 
18 {
19  if(x < other.x)
20  {
21  return true;
22  }
23  else if(y < other.y)
24  {
25  return true;
26  }
27  else if(theta < other.theta)
28  {
29  return true;
30  }
31  return false;
32 }
33 
35 {
36  return sqrt(pow(other.x - x, 2) + pow(other.y - y, 2));
37 }
float distTo(SearchLocation other)
static constexpr float sameness_threshold
bool operator<(const SearchLocation &other) const
bool operator==(const SearchLocation &other)


igvc
Author(s): Matthew Barulic , Al Chaussee
autogenerated on Sun May 10 2015 16:18:45