MMKGeo

@interface MMKGeo : NSObject

Undocumented

Summary

Class methods

+ (double)distanceWithFirstPoint:(nonnull MMKPoint *)firstPoint
                     secondPoint:(nonnull MMKPoint *)secondPoint;

Calculate the great-circle distance between two points on a sphere with a radius equal to the Earth's radius using the haversine formula described here: http://en

+ (nonnull MMKPoint *)closestPointWithPoint:(nonnull MMKPoint *)point
                                    segment:(nonnull MMKSegment *)segment;

Find the point on a given segment (great-circle arc or shorter arc) that is closest to a given point

+ (nonnull MMKPoint *)pointOnSegmentByFactorWithSegment:
                          (nonnull MMKSegment *)segment
                                                 factor:(double)factor;

Find a point X on a given segment AB such that d(AX)/d(AB) = factor, where factor is a given number in [0, 1]

+ (double)courseWithFirstPoint:(nonnull MMKPoint *)firstPoint
                   secondPoint:(nonnull MMKPoint *)secondPoint;

Calculate the course (bearing) between two points in degrees in the range [0, 360]

Class methods

distanceWithFirstPoint:secondPoint:

+ (double)distanceWithFirstPoint:(nonnull MMKPoint *)firstPoint
                     secondPoint:(nonnull MMKPoint *)secondPoint;

Calculate the great-circle distance between two points on a sphere with a radius equal to the Earth's radius using the haversine formula described here: http://en.wikipedia.org/wiki/Haversine_formula

This formula is numerically better-conditioned for small distances, according to http://en.wikipedia.org/wiki/Great-circle_distance


closestPointWithPoint:segment:

+ (nonnull MMKPoint *)closestPointWithPoint:(nonnull MMKPoint *)point
                                    segment:(nonnull MMKSegment *)segment;

Find the point on a given segment (great-circle arc or shorter arc) that is closest to a given point.


pointOnSegmentByFactorWithSegment:factor:

+ (nonnull MMKPoint *)pointOnSegmentByFactorWithSegment:
                          (nonnull MMKSegment *)segment
                                                 factor:(double)factor;

Find a point X on a given segment AB such that d(AX)/d(AB) = factor, where factor is a given number in [0, 1].


courseWithFirstPoint:secondPoint:

+ (double)courseWithFirstPoint:(nonnull MMKPoint *)firstPoint
                   secondPoint:(nonnull MMKPoint *)secondPoint;

Calculate the course (bearing) between two points in degrees in the range [0, 360].