coordinates

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const EarthRadius = 6371e3

EarthRadius is the radium of the earth in meters

Variables

This section is empty.

Functions

func ToRadians

func ToRadians(f float64) float64

ToRadians converts a number in degrees to radians

Types

type Point

type Point struct {
	Latitude  float64 `json:"lat"`
	Longitude float64 `json:"lon"`
}

Point represents a point on earth

func Lerp

func Lerp(from, to Point, t float64) (output Point)

Lerp Linear interpolation between two points for a parameter t

func (Point) DistanceTo

func (coords Point) DistanceTo(target Point) float64

DistanceTo target from point (meters)

func (Point) Unwrap

func (coords Point) Unwrap() (latitude, longitude float64)

Unwrap returns the latitude and longitude of a Coordinates struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL