2 #include <samchon/protocol/Entity.hpp> 6 #include <samchon/library/Math.hpp> 7 #include <samchon/library/StringUtil.hpp> 8 #include <samchon/library/XML.hpp> 18 using namespace library;
19 using namespace protocol;
90 this->longitude = longitude;
91 this->latitude = latitude;
96 virtual void construct(shared_ptr<XML> xml)
override 98 uid = xml->getProperty<
int>(
"uid");
99 longitude = xml->getProperty<
double>(
"longitude");
100 latitude = xml->getProperty<
double>(
"latitude");
106 virtual auto key() const ->
int override 119 if (longitude == point.longitude && latitude == point.latitude)
124 double theta = this->longitude - point.longitude;
127 sin(latitude_radian1) * sin(latitude_radian2)
132 val = val * 60 * 1.1515;
133 val = val * 1.609344;
141 virtual auto TAG()
const ->
string 146 auto toXML()
const -> shared_ptr<XML>
override 148 shared_ptr<XML> &xml = super::toXML();
149 xml->setProperty(
"uid", uid);
150 xml->setProperty(
"longitude", longitude);
151 xml->setProperty(
"latitude", latitude);
169 uid, longitude, latitude
GeometryPoint(int uid)
Construct from uid.
An entity, a standard data class.
static auto radian_to_degree(double val) -> double
Convert radian to degree.
virtual auto key() const -> int override
Get a key that can identify the Entity uniquely.
int uid
An unique id for uniqueness.
GeometryPoint()
Default Constructor.
auto calcDistance(const GeometryPoint &point) const -> double
Calculate distance between target Branch.
double latitude
The latitude, coordinates Y.
GeometryPoint(int uid, double longitude, double latitude)
Construct from uid and geometry coordinates.
double longitude
The longitude; coordinates X.
static auto substitute(const std::string &format, const T &val, const _Args &...args) -> std::string
Substitutes "{n}" tokens within the specified string with the respective arguments passed in...
auto toString() const -> string
Convert the Branch to String.
A geometry coordinates (point)
static auto random() -> double
Get a random value.
static auto degree_to_radian(double val) -> double
Convert degree to radian.