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 ->
string override 108 return to_string(uid);
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 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
An entity, a standard data class.
auto toXML() const -> shared_ptr< XML > override
Get an XML object represents the Entity.
static auto random() -> double
Get a random value.
GeometryPoint(int uid, double longitude, double latitude)
Construct from uid and geometry coordinates.
auto calcDistance(const GeometryPoint &point) const -> double
Calculate distance between target Branch.
double longitude
The longitude; coordinates X.
double latitude
The latitude, coordinates Y.
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...
virtual auto TAG() const -> string
A tag name when represented by XML.
virtual auto key() const -> string override
Get a key that can identify the Entity uniquely.
GeometryPoint(int uid)
Construct from uid.
static auto degree_to_radian(double) -> double
Convert degree to radian.
A geometry coordinates (point)
XML is a class representing xml object.
int uid
An unique id for uniqueness.
static auto radian_to_degree(double) -> double
Convert radian to degree.
GeometryPoint()
Default Constructor.
Top level namespace of products built from samchon.
auto toString() const -> string
Convert the Branch to String.