fibonaccisphere: Evenly distributed n points on a sphere

View source: R/fibonaccisphere.R

fibonaccisphereR Documentation

Evenly distributed n points on a sphere

Description

Distributes n points on a sphere in a relatively even fashion following the generalised Fibonacci algorithm, described at http://extremelearning.com.au/evenly-distributing-points-on-a-sphere/

Usage

fibonaccisphere(n = 1000, r = 1, out.xyz = TRUE, out.sph = FALSE)

Arguments

n

number of points to be placed on the sphere

r

radius

out.xyz

logical flag specifying whether to return Cartesian coordinates (default is TRUE)

out.sph

logical flag specifying whether to return spherical coordinates (default is FALSE); theta=colatitute (=polar angle=angle from z-axis), phi=longitude (=azimuth angle),

Value

matrix of n points (in n rows), in Cartesian and/or spherical coordinates.

Author(s)

Danail Obreschkow

See Also

runif3

Examples

## plot standard projections of a 1000-point Fibonacci sphere
xyz = fibonaccisphere()
plot(xyz, asp=1, pch=16, cex=0.5)


obreschkow/cooltools documentation built on Nov. 16, 2024, 2:46 a.m.