points

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package points contains multiple example implementations of the kdtree.Point interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	Coordinates []float64
	Data        interface{}
}

Point represents a n-dimensional point of the k-d tree.

func NewPoint

func NewPoint(coordinates []float64, data interface{}) *Point

NewPoint creates a new point at the given coordinates and contains the given data.

func (*Point) Dimension

func (p *Point) Dimension(i int) float64

Dimension returns the value of the i-th dimension.

func (*Point) Dimensions

func (p *Point) Dimensions() int

Dimensions returns the total number of dimensions.

func (*Point) String

func (p *Point) String() string

String returns the string representation of the point.

type Point2D

type Point2D struct {
	X float64
	Y float64
}

Point2D ...

func (*Point2D) Dimension

func (p *Point2D) Dimension(i int) float64

Dimension ...

func (*Point2D) Dimensions

func (p *Point2D) Dimensions() int

Dimensions ...

func (*Point2D) String

func (p *Point2D) String() string

String ...

type Point3D

type Point3D struct {
	X float64
	Y float64
	Z float64
}

Point3D ...

func (*Point3D) Dimension

func (p *Point3D) Dimension(i int) float64

Dimension ...

func (*Point3D) Dimensions

func (p *Point3D) Dimensions() int

Dimensions ...

func (*Point3D) String

func (p *Point3D) String() string

String ...

Jump to

Keyboard shortcuts

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