Class Geo

Package world.mappable.mapkit.geometry

java.lang.Object
    ↳ world.mappable.mapkit.geometry.Geo

class Geo

Summary

Constructors

Signature and Description

Geo()

Methods

Type and modifiers

Method and Description

static native double

distance(@NonNull Point firstPoint,
         @NonNull Point 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

static native Point

closestPoint(@NonNull Point point,
             @NonNull Segment segment)

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

static native Point

pointOnSegmentByFactor(@NonNull Segment segment,
                       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].

static native double

course(@NonNull Point firstPoint,
       @NonNull Point secondPoint)

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

Constuctors

Geo

Geo()


Methods

distance

double distance(@NonNull Point firstPoint,
                @NonNull Point 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


closestPoint

@NonNull
Point closestPoint(@NonNull Point point,
                   @NonNull Segment segment)

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


pointOnSegmentByFactor

@NonNull
Point pointOnSegmentByFactor(@NonNull Segment segment,
                             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].


course

double course(@NonNull Point firstPoint,
              @NonNull Point secondPoint)

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


Previous