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 (*Segment) Contains ¶
func (seg *Segment) Contains(point Coordinate) bool
func (*Segment) Intersection ¶
func (seg *Segment) Intersection(other *Segment) (Coordinate, bool)
Click to show internal directories.
Click to hide internal directories.