coordinate

package
v0.0.0-...-36d9f8f Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EuclideanDistance

func EuclideanDistance(c1, c2 Coordinate) float64

func ManhattanDistance

func ManhattanDistance(c1, c2 Coordinate) float64

Types

type Coordinate

type Coordinate interface {
	Get(i int) float64
	Cardinality() int
	Add(addend Coordinate) Coordinate
	Subtract(subtrahend Coordinate) Coordinate
	Multiply(multiplier Coordinate) Coordinate
	Equal(other Coordinate) bool
}

func New

func New(coordinates ...float64) Coordinate

type Segment

type Segment struct {
	Start Coordinate
	End   Coordinate
	// contains filtered or unexported fields
}

func NewSegment

func NewSegment(start, end Coordinate) *Segment

func (*Segment) Coincident

func (seg *Segment) Coincident(other *Segment) bool

func (*Segment) Contains

func (seg *Segment) Contains(point Coordinate) bool

func (*Segment) Intersection

func (seg *Segment) Intersection(other *Segment) (Coordinate, bool)

func (*Segment) Length

func (seg *Segment) Length() int

func (*Segment) String

func (seg *Segment) String() string

Jump to

Keyboard shortcuts

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