Skip to contents

This function generates data points along a conic spiral curve with optional noise.

Usage

conic_spiral_3d(n, num_noise, min_n, max_n)

Arguments

n

Total number of data points to generate.

num_noise

Number of additional noise dimensions to add to the data.

min_n

Minimum value for the noise added to the data.

max_n

Maximum value for the noise added to the data.

Value

A matrix containing the generated data points with or without added noise.

Examples

set.seed(20240412)
conic_spiral_3d(n = 100, num_noise = 2, min_n = -0.05, max_n = 0.05)
#>                    x            y           z                           
#>   [1,]  0.1652705399  0.197655432  0.56196756  0.046811273 -0.0397026339
#>   [2,] -0.0503955365 -0.214441320  0.37706739 -0.012496258  0.0290763175
#>   [3,] -0.1261257283 -0.113418205  0.81181242 -0.039036306  0.0422360181
#>   [4,]  0.2665173598 -0.123134358  0.45560915  0.012114244 -0.0214310022
#>   [5,]  0.0996705791  0.091156521  0.54774636 -0.007777032 -0.0499433291
#>   [6,]  0.0437924361 -0.099445170  0.41508432 -0.043311664 -0.0356851794
#>   [7,] -0.2340716670  0.346800356  0.18236676  0.009618158  0.0015637302
#>   [8,]  0.0439289356  0.126512734  0.58797019  0.040446538 -0.0123396746
#>   [9,]  0.1480882404 -0.061412971  0.48396567 -0.049745073 -0.0284339315
#>  [10,]  0.0769614733 -0.104517663  0.92548686 -0.015265306 -0.0350829806
#>  [11,]  0.0321642128 -0.102515589  0.89670361  0.036571148 -0.0353439124
#>  [12,]  0.0928606406  0.037877951  0.03250360  0.015919120  0.0423142502
#>  [13,]  0.0460846298 -0.092542179  0.91011412 -0.031443569 -0.0051962465
#>  [14,]  0.0694460398  0.076145771  0.07151625  0.044940477 -0.0389469245
#>  [15,] -0.0574431914  0.133410012  0.66761320 -0.028938895 -0.0086575911
#>  [16,] -0.0531663776  0.159754791  0.12888588  0.013595432  0.0232040592
#>  [17,]  0.0523673056  0.141408954  0.11676387  0.002368991 -0.0245691278
#>  [18,]  0.1633681435  0.026015119 -0.01080325 -0.030572272 -0.0315889175
#>  [19,] -0.1508265735  0.082564605  0.18905609 -0.018436977  0.0227344875
#>  [20,] -0.1212481578  0.335913044  0.12947682  0.045953311 -0.0366494890
#>  [21,] -0.3775116267  0.031377390  0.23042905  0.034806118  0.0157848667
#>  [22,]  0.2407401225  0.059480024  0.53216298  0.004200594  0.0070135517
#>  [23,]  0.0859179028 -0.065061982  0.45489713 -0.030929957  0.0208199039
#>  [24,]  0.1189491519  0.222318807  0.59311723 -0.023326323 -0.0189224581
#>  [25,]  0.0662781347  0.110313469  0.57191298  0.038856192  0.0338216087
#>  [26,]  0.0633287178 -0.084667759  0.92424468  0.036005257 -0.0460992394
#>  [27,] -0.0736354460  0.076480478  0.17892801 -0.005547783  0.0447378346
#>  [28,]  0.0521597046 -0.086409012  0.91735178  0.010797826  0.0272497393
#>  [29,]  0.0144862076 -0.131029745  0.88720095  0.029635492 -0.0160971409
#>  [30,]  0.1030225527 -0.014904482  0.98834397  0.009967849  0.0464448324
#>  [31,] -0.0317932811  0.115590059  0.15908594 -0.006457079  0.0179349351
#>  [32,] -0.1179802964  0.314892306  0.17827294 -0.030954550 -0.0207382537
#>  [33,] -0.0119618902  0.126641643  0.62340828 -0.025088984  0.0037443788
#>  [34,]  0.0836894919 -0.073383346  0.94089059  0.031934072 -0.0118583800
#>  [35,]  0.1007341092  0.098191771  0.04291249 -0.035403466  0.0063740385
#>  [36,] -0.1157049076  0.054273855  0.72288678 -0.042859625 -0.0297865495
#>  [37,] -0.1069723154 -0.003305185  0.75650346 -0.034428535 -0.0433482581
#>  [38,]  0.0456057180 -0.121483918  0.90100170  0.034162961 -0.0163532625
#>  [39,]  0.0819433093  0.218396768  0.06868350 -0.045406635  0.0359919606
#>  [40,] -0.2740627274  0.157893565  0.23185376  0.012260502 -0.0370901504
#>  [41,]  0.0442711388  0.258241515  0.13966080  0.002252682 -0.0496382012
#>  [42,] -0.1898921012  0.003656120  0.75340162  0.004865140  0.0114451926
#>  [43,] -0.0364220198 -0.152715791  0.85556012  0.037104514 -0.0157686300
#>  [44,] -0.2401621261  0.315221993  0.16107495  0.019189041 -0.0482725061
#>  [45,] -0.0475882714  0.223957195  0.64851466  0.016947191  0.0417446218
#>  [46,]  0.2071281625  0.069749153  0.51123541  0.023474528  0.0490760001
#>  [47,]  0.0971114179 -0.052560033  0.46788593 -0.046460505 -0.0143416769
#>  [48,] -0.2548529530  0.268059306  0.16593710 -0.014047195 -0.0389693632
#>  [49,] -0.0532109435 -0.130509646  0.32904039 -0.002774406 -0.0050521928
#>  [50,]  0.0421894330  0.285217974  0.08514373  0.021978159 -0.0338490285
#>  [51,]  0.0950771463  0.243899817  0.59494467  0.001459893  0.0007207744
#>  [52,]  0.0874246501  0.075427410  0.54868476 -0.032680244  0.0358561296
#>  [53,] -0.0354734229  0.216252480  0.62913467 -0.006952650 -0.0343432767
#>  [54,]  0.2656597028  0.046356794  0.04483268  0.049056897  0.0380912595
#>  [55,]  0.1819985251  0.171537011  0.55023318 -0.037429136 -0.0017651984
#>  [56,] -0.0388461917  0.113135287  0.65903762  0.040186682  0.0271230818
#>  [57,]  0.0072851823 -0.111475590  0.37182156  0.037823953 -0.0153674109
#>  [58,] -0.1712406520  0.128214836  0.70319892 -0.013801423 -0.0435791666
#>  [59,] -0.0521091851 -0.292724400  0.37804870  0.014180800 -0.0007038843
#>  [60,] -0.0156651304 -0.099808397  0.86379751  0.016110678 -0.0042624283
#>  [61,]  0.0001969794  0.128084093  0.10974355  0.045699345  0.0307058573
#>  [62,]  0.0648762577 -0.174703181  0.38504121 -0.017281139 -0.0172181919
#>  [63,]  0.0257079332 -0.098954199  0.89372679 -0.022220930  0.0344564827
#>  [64,]  0.1364136357 -0.002313632  0.51095689  0.048801365 -0.0145525717
#>  [65,]  0.0710564382 -0.106525297  0.92332611  0.007458667  0.0024064121
#>  [66,] -0.1109366693  0.174632821  0.14534892 -0.033425671  0.0470545179
#>  [67,] -0.0849568255  0.423912518  0.13095956 -0.035560294 -0.0429631366
#>  [68,] -0.1382339309  0.033387622  0.72278301  0.046699327  0.0314480813
#>  [69,] -0.1089722775  0.292256888  0.12731943  0.021227714 -0.0469257004
#>  [70,]  0.2013966349  0.197723048  0.03191514  0.028738201  0.0067218661
#>  [71,] -0.0566907701  0.131776282  0.66748087 -0.048813058 -0.0365070718
#>  [72,] -0.1063010396  0.055317306  0.71874140 -0.025414831  0.0148092618
#>  [73,]  0.0176651913 -0.128185950  0.88241999 -0.044960774 -0.0288158743
#>  [74,]  0.0353068477  0.139845606  0.08657420 -0.032921567 -0.0393909458
#>  [75,]  0.1402746081 -0.267844813  0.40052641  0.004026652 -0.0436995254
#>  [76,]  0.0256392128 -0.137361909  0.89178698  0.014284641 -0.0465217978
#>  [77,] -0.1280522272 -0.033046939  0.25553312 -0.032963758 -0.0291392233
#>  [78,] -0.0728610624  0.070311875  0.68693820  0.049464466  0.0114881480
#>  [79,] -0.3345972845 -0.140922125  0.26900981 -0.036069776 -0.0194828836
#>  [80,]  0.1072902918  0.173998034  0.05464647  0.020289299 -0.0485348954
#>  [81,] -0.1780656377 -0.202959143  0.29663925  0.036633093 -0.0097199444
#>  [82,] -0.1876751116  0.087116421  0.71974687 -0.029914531 -0.0044783109
#>  [83,] -0.0143729079 -0.101694819  0.35967328  0.035608689  0.0366461525
#>  [84,]  0.0608352925  0.143715936  0.07226579  0.030768446 -0.0395055116
#>  [85,] -0.0931896338 -0.056221115  0.28536875  0.022653194 -0.0053874930
#>  [86,]  0.0795980598 -0.239474206  0.41890499  0.014886355  0.0058034629
#>  [87,] -0.0043018994 -0.199315030  0.39279846 -0.003475857  0.0060975001
#>  [88,] -0.0993007126  0.069212199  0.70880013  0.021506445 -0.0234173421
#>  [89,]  0.2835643239 -0.131126037  0.46281453  0.031937469  0.0187736356
#>  [90,]  0.3793856712  0.279113500  0.04137405 -0.037160310 -0.0442129100
#>  [91,]  0.2312444607 -0.045258701  0.50018499  0.049801787 -0.0419374371
#>  [92,] -0.0618468942 -0.271872287  0.37603289  0.012772074 -0.0498900986
#>  [93,]  0.0845594947 -0.084146447  0.93603629  0.005877741  0.0109741065
#>  [94,] -0.1536838003 -0.070743683  0.30383456  0.025761254 -0.0074751925
#>  [95,]  0.1281951569  0.326210654  0.12179217  0.027342288 -0.0305212979
#>  [96,]  0.0798742454  0.134807525  0.59502223 -0.035392174 -0.0172342707
#>  [97,]  0.0589677022 -0.112630134  0.42532349  0.018060863 -0.0040695532
#>  [98,] -0.3552016390  0.080158976  0.24928544 -0.004448415  0.0392953042
#>  [99,] -0.0715559521 -0.102026048  0.83161640 -0.047147391  0.0337261188
#> [100,]  0.4071285057  0.187344014  0.01598701 -0.017987990  0.0190098491