Skip to contents

Creates a sphere.

Usage

sphere(radius_body, n_segments = 100, diameter_units = "m")

Arguments

radius_body

Object radius (m).

n_segments

Number of segments to discretize object shape. Defaults to 1e2 segments.

diameter_units

Default is "m" for meters

Value

Creates position vector for a spherical object of a defined radius.

See also

Examples

sphere(radius_body = 0.01, n_segments = 50)
#> An object of class "Sphere"
#> Slot "position_matrix":
#>            x y z          zU           zL
#>  [1,] 0.0200 0 0 0.000000000  0.000000000
#>  [2,] 0.0196 0 0 0.002800000 -0.002800000
#>  [3,] 0.0192 0 0 0.003919184 -0.003919184
#>  [4,] 0.0188 0 0 0.004749737 -0.004749737
#>  [5,] 0.0184 0 0 0.005425864 -0.005425864
#>  [6,] 0.0180 0 0 0.006000000 -0.006000000
#>  [7,] 0.0176 0 0 0.006499231 -0.006499231
#>  [8,] 0.0172 0 0 0.006939741 -0.006939741
#>  [9,] 0.0168 0 0 0.007332121 -0.007332121
#> [10,] 0.0164 0 0 0.007683749 -0.007683749
#> [11,] 0.0160 0 0 0.008000000 -0.008000000
#> [12,] 0.0156 0 0 0.008284926 -0.008284926
#> [13,] 0.0152 0 0 0.008541663 -0.008541663
#> [14,] 0.0148 0 0 0.008772685 -0.008772685
#> [15,] 0.0144 0 0 0.008979978 -0.008979978
#> [16,] 0.0140 0 0 0.009165151 -0.009165151
#> [17,] 0.0136 0 0 0.009329523 -0.009329523
#> [18,] 0.0132 0 0 0.009474175 -0.009474175
#> [19,] 0.0128 0 0 0.009600000 -0.009600000
#> [20,] 0.0124 0 0 0.009707729 -0.009707729
#> [21,] 0.0120 0 0 0.009797959 -0.009797959
#> [22,] 0.0116 0 0 0.009871170 -0.009871170
#> [23,] 0.0112 0 0 0.009927739 -0.009927739
#> [24,] 0.0108 0 0 0.009967949 -0.009967949
#> [25,] 0.0104 0 0 0.009991997 -0.009991997
#> [26,] 0.0100 0 0 0.010000000 -0.010000000
#> [27,] 0.0096 0 0 0.009991997 -0.009991997
#> [28,] 0.0092 0 0 0.009967949 -0.009967949
#> [29,] 0.0088 0 0 0.009927739 -0.009927739
#> [30,] 0.0084 0 0 0.009871170 -0.009871170
#> [31,] 0.0080 0 0 0.009797959 -0.009797959
#> [32,] 0.0076 0 0 0.009707729 -0.009707729
#> [33,] 0.0072 0 0 0.009600000 -0.009600000
#> [34,] 0.0068 0 0 0.009474175 -0.009474175
#> [35,] 0.0064 0 0 0.009329523 -0.009329523
#> [36,] 0.0060 0 0 0.009165151 -0.009165151
#> [37,] 0.0056 0 0 0.008979978 -0.008979978
#> [38,] 0.0052 0 0 0.008772685 -0.008772685
#> [39,] 0.0048 0 0 0.008541663 -0.008541663
#> [40,] 0.0044 0 0 0.008284926 -0.008284926
#> [41,] 0.0040 0 0 0.008000000 -0.008000000
#> [42,] 0.0036 0 0 0.007683749 -0.007683749
#> [43,] 0.0032 0 0 0.007332121 -0.007332121
#> [44,] 0.0028 0 0 0.006939741 -0.006939741
#> [45,] 0.0024 0 0 0.006499231 -0.006499231
#> [46,] 0.0020 0 0 0.006000000 -0.006000000
#> [47,] 0.0016 0 0 0.005425864 -0.005425864
#> [48,] 0.0012 0 0 0.004749737 -0.004749737
#> [49,] 0.0008 0 0 0.003919184 -0.003919184
#> [50,] 0.0004 0 0 0.002800000 -0.002800000
#> [51,] 0.0000 0 0 0.000000000  0.000000000
#> 
#> Slot "shape_parameters":
#> $radius_shape
#>  [1] 0.000000000 0.002800000 0.003919184 0.004749737 0.005425864 0.006000000
#>  [7] 0.006499231 0.006939741 0.007332121 0.007683749 0.008000000 0.008284926
#> [13] 0.008541663 0.008772685 0.008979978 0.009165151 0.009329523 0.009474175
#> [19] 0.009600000 0.009707729 0.009797959 0.009871170 0.009927739 0.009967949
#> [25] 0.009991997 0.010000000 0.009991997 0.009967949 0.009927739 0.009871170
#> [31] 0.009797959 0.009707729 0.009600000 0.009474175 0.009329523 0.009165151
#> [37] 0.008979978 0.008772685 0.008541663 0.008284926 0.008000000 0.007683749
#> [43] 0.007332121 0.006939741 0.006499231 0.006000000 0.005425864 0.004749737
#> [49] 0.003919184 0.002800000 0.000000000
#> 
#> $diameter_shape
#> [1] 0.02
#> 
#> $radius
#> [1] 0.01
#> 
#> $n_segments
#> [1] 50
#> 
#> $diameter_units
#> [1] "m"
#> 
#>