fan.sphere {espadon} | R Documentation |
Creation of spherical fan object.
Description
The fan.sphere
function creates a "fan" class object
containing, among others, the coordinates of the unit director vectors of
the rays of a spherical fan.
Usage
fan.sphere(
angle = 1,
method = c("regular", "random"),
origin = c(0, 0, 0),
ref.pseudo = "ref1",
frame.of.reference = "",
alias = "",
description = "spherical fan"
)
Arguments
angle |
Positive number specifying the angle (or mean angle in case of
|
method |
Requested method of fan calculation from among 'regular' and
'random'. By default, |
origin |
Numeric vector, giving the xyz coordinates of the fan origin.
By default |
ref.pseudo |
Character string, frame of reference pseudonym of the created object. |
frame.of.reference |
Character string, frame of reference of the created object. |
alias |
Character string, |
description |
Character string, describing the the created object. |
Details
The "regular" and "random" method are explained by Deserno [1].
If
method = "regular"
, the returned vectors composing$xyz
matrix are regularly equidistributed at the specified angle.If
method = "random"
, the returned vectors composing$xyz
matrix are randomly equidistributed at the specified angle.
Value
Returns a "fan" class object (see espadon.class for class definitions) containing, among others,
-
$xyz
: a matrix of 3 columns giving the xyz coordinates of the fan rays. -
$local
: a matrix of 2 columns indicating the polar angletheta
(rad) and the azimuthal anglephi
(rad) of each ray are added.
References
[1] Deserno, Markus (Online; accessed 2022-08-24). “How to generate equidistributed points on the surface of a sphere.” https://www.cmu.edu/biolphys/deserno/pdf/sphere_equi.pdf.
See Also
fan.beam, fan.planar, fan.to.voxel
Examples
regular.fan <- fan.sphere (angle = 30)
head (regular.fan$xyz)
random.fan <- fan.sphere (angle = 30, method = "random")
head (random.fan$xyz)
library (rgl)
open3d ()
points3d (regular.fan$xyz)
open3d ()
points3d (random.fan$xyz)