algo

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Box added in v1.3.0

func Box(
	targetMin, targetMax [2]float64, wrapX bool,
	itemDist func(min, max [2]float64, data interface{}) float64,
) (
	algo func(min, max [2]float64, data interface{}, item bool) (dist float64),
)

Box performs simple box-distance algorithm on rectangles. When wrapX is provided, the operation does a cylinder wrapping of the X value to allow for antimeridian calculations. When itemDist is provided (not nil), it becomes the caller's responsibility to return the box-distance.

func BoxDistCalc added in v1.3.0

func BoxDistCalc(aMin, aMax, bMin, bMax [2]float64, wrapX bool) float64

BoxDistCalc returns the distance from rectangle A to rectangle B. When wrapX is provided, the operation does a cylinder wrapping of the X value to allow for antimeridian calculations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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