sphere {cardinalR}R Documentation

Generate Coordinates for a Sphere

Description

This function generates the coordinates for a sphere in three-dimensional space.

Usage

sphere(radius, resolution, num_noise, min_n, max_n)

Arguments

radius

The radius of the sphere.

resolution

The number of points used to approximate the surface of the sphere.

num_noise

The number of additional noise dimensions to add to the coordinates.

min_n

The minimum value for the random noise added to the coordinates.

max_n

The maximum value for the random noise added to the coordinates.

Value

A matrix containing the Cartesian coordinates of the points on the sphere.

Examples

# Generate coordinates for a sphere with radius 1 and resolution 20
set.seed(20240412)
sphere(
  radius = 1, resolution = 20, num_noise = 3, min_n = -0.05,
  max_n = 0.05
)


[Package cardinalR version 0.1.1 Index]