geospatial

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FloatPrecision = 8
	FloatBitSize   = 64
)

Variables

This section is empty.

Functions

func PointStr

func PointStr(lat, lon float64) string

func PolygonStr

func PolygonStr(points ...[]float64) string

Types

type GeoPoint

type GeoPoint struct {
	Type        string    `json:"type"`
	Coordinates []float64 `json:"coordinates"`
}

func (*GeoPoint) GetPoint

func (p *GeoPoint) GetPoint() Point

type Point

type Point struct {
	// contains filtered or unexported fields
}

Point describe point

func NewPoint

func NewPoint(s ...float64) Point

NewPoint return new point

func (Point) Coordinate

func (p Point) Coordinate(i int) float64

Coordinate return coordinate for dimension (0-x, 1-y, 2-z)

func (Point) Coordinates

func (p Point) Coordinates() [3]float64

Coordinates return all coordinates

func (Point) Distance

func (p Point) Distance(p2 Vector) float64

Distance return distance between positions (euclidean)

func (Point) DistanceSquare

func (p Point) DistanceSquare(p2 Vector) float64

DistanceSquare return distance square between positions (euclidean)

func (Point) Dot

func (p Point) Dot(p2 Vector) float64

Dot scalar multiply

func (Point) Normal

func (p Point) Normal() float64

Normal returns the vector's norm.

func (Point) NormalSquare

func (p Point) NormalSquare() float64

NormalSquare returns the vector's norm square.

type Vector

type Vector interface {
	Coordinate(i int) (r float64)
	Coordinates() [3]float64
}

Vector describe any vector point

Jump to

Keyboard shortcuts

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