geometry

package
v0.0.0-...-a9d970f Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package geometry implement some basic geometry functions for 2-D points.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(a, b [2]float64) float64

Distance returns the Euclidean distance between two points.

func DistanceSquared

func DistanceSquared(a, b [2]float64) float64

DistanceSquared returns the square of the Euclidean distance between two points.

Types

type BoundingBox

type BoundingBox struct {
	From, To [2]float64
}

A BoundingBox is an axis-aligned bounding box.

func (*BoundingBox) Contains

func (bb *BoundingBox) Contains(p [2]float64) bool

Contains returns true if the point is in the bounding box.

Jump to

Keyboard shortcuts

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