2015-12-08 04:51:55 +08:00
|
|
|
#pragma once
|
2015-06-19 16:04:42 +08:00
|
|
|
|
|
|
|
#include <ostream>
|
|
|
|
|
|
|
|
namespace kd {
|
|
|
|
|
|
|
|
template <class T>
|
2017-02-18 18:54:37 +08:00
|
|
|
class Point {
|
|
|
|
public:
|
|
|
|
Point(T latitude, T longitude) : latitude(latitude), longitude(longitude) {}
|
2015-06-19 16:04:42 +08:00
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
// latitude
|
|
|
|
// y
|
|
|
|
// ^
|
|
|
|
// |
|
|
|
|
// 0---> x longitude
|
2015-06-19 16:04:42 +08:00
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
T latitude;
|
|
|
|
T longitude;
|
2015-06-19 16:04:42 +08:00
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
/// nice stream formatting with the standard << operator
|
|
|
|
friend std::ostream& operator<<(std::ostream& stream, const Point& p) {
|
|
|
|
return stream << "(lat: " << p.latitude << ", lng: " << p.longitude << ')';
|
|
|
|
}
|
2015-06-19 16:04:42 +08:00
|
|
|
};
|
|
|
|
}
|