MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getDistance

Method getDistance

src/Savegame/Target.cpp:153–156  ·  view source on GitHub ↗

* Returns the great circle distance to another * target on the globe. * @param target Pointer to other target. * @returns Distance in radian. */

Source from the content-addressed store, hash-verified

151 * @returns Distance in radian.
152 */
153double Target::getDistance(const Target *target) const
154{
155 return acos(cos(_lat) * cos(target->getLatitude()) * cos(target->getLongitude() - _lon) + sin(_lat) * sin(target->getLatitude()));
156}
157
158}

Callers 3

time5SecondsMethod · 0.45
operator()Method · 0.45
time10MinutesMethod · 0.45

Calls 2

getLatitudeMethod · 0.45
getLongitudeMethod · 0.45

Tested by

no test coverage detected