# Class Geo

com.yandex.mapkit.geometry

public class Geo

Geo helper methods.

## Methods

 native PolylinePosition advancePolylinePosition( Polyline polyline, PolylinePosition position, double distance) Advance the polyline position by a specified distance in meters. native Point closestPoint( Point point, Segment segment) Find the point on a given segment (great-circle arc or shorter arc) that is closest to a given point. native double course( Point firstPoint, Point secondPoint) Calculate the course (bearing) between two points in degrees in the range [0, 360]. native double distance( Point firstPoint, 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. native Point pointOnSegmentByFactor( Segment segment, double lambda) Find a point X on a given segment AB such that d(AX)/d(AB) = lambda, where lambda is a given number in [0, 1].

## Method Detail

`public static native PolylinePosition advancePolylinePosition (Polyline polyline, PolylinePosition position, double distance)`

Advance the polyline position by a specified distance in meters.

### closestPoint

`public static native Point closestPoint (Point point, Segment segment)`

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

### course

`public static native double course (Point firstPoint, Point secondPoint)`

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

### distance

`public static native double distance (Point firstPoint, 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

### pointOnSegmentByFactor

`public static native Point pointOnSegmentByFactor (Segment segment, double lambda)`

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