place

package
v0.0.0-...-d41ed40 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(p, q Coord) (mi, km float64)

Distance calculates the shortest path between two coordinates on the surface of the Earth. This function returns two units of measure, the first is the distance in miles, the second is the distance in kilometers.

Types

type Attributes

type Attributes struct {
	Coord
	Name      string
	CreatedAt time.Time
}

func NewAttributes

func NewAttributes(name string, lat, lng float64) Attributes

type Coord

type Coord struct {
	Lat float64
	Lng float64
}

type Place

type Place struct {
	ID int64
	Attributes
}

func (Place) DistanceToKm

func (p Place) DistanceToKm(q Place) float64

Jump to

Keyboard shortcuts

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