Skip to contents

k-th nearest neighbour angles and distances

Usage

knnangle(x, k = 1, from, to)

Arguments

x

Matrix of coordinates, n rows and d columns

k

k-th nearest neighbour

from

From these indices (default all 1,...,nrow(x))

to

To these indices (default all)

Value

The values in 2d are (azimuth, distance) The values in 3d are physical coordinate system (azimuth, inclination, distance)

Details

If 2d, returns the angle in [-pi, pi]. In 3d also the angle from xy-plane in [0,pi]