Learn R Programming

espadon (version 1.11.3)

fan.sphere: 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"
)

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 angle theta (rad) and the azimuthal angle phi (rad) of each ray are added.

Arguments

angle

Positive number specifying the angle (or mean angle in case of method = "random") between two nearest vectors.

method

Requested method of fan calculation from among 'regular' and 'random'. By default, method = regular. See details.

origin

Numeric vector, giving the xyz coordinates of the fan origin. By default c (0, 0, 0).

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, $alias of the created object.

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.

References

[1] Desernoespadon

See Also

fan.beam, fan.planar, fan.to.voxel

Examples

Run this code
regular.fan <- fan.sphere (angle = 30)
head (regular.fan$xyz)
random.fan <- fan.sphere (angle = 30, method = "random")
head (random.fan$xyz)
if (interactive()){
  rgl::open3d ()
  rgl::points3d (regular.fan$xyz)
  rgl::open3d ()
  rgl::points3d (random.fan$xyz)
}

Run the code above in your browser using DataLab