Skip to contents

tfourier_i uses the inverse tangent angle Fourier transformation to calculate a shape, when given a list with Fourier coefficients, typically obtained computed with tfourier.

Usage

tfourier_i(
  tf,
  nb.h,
  nb.pts = 120,
  force2close = FALSE,
  rescale = TRUE,
  perim = 2 * pi,
  thetao = 0
)

Arguments

tf

a list with ao, an and bn components, typically as returned by tfourier

nb.h

integer. The number of harmonics to calculate/use

nb.pts

integer. The number of points to calculate

force2close

logical. Whether to force the outlines calculated to close (see coo_force2close).

rescale

logical. Whether to rescale the points calculated so that their perimeter equals perim.

perim

The perimeter length to rescale shapes.

thetao

numeric. Radius angle to the reference (in radians)

Value

A list with components:

x

vector of x-coordinates.

y

vector of y-coordinates.

phi

vector of interpolated changes on the tangent angle.

angle

vector of position on the perimeter (in radians).

Details

See tfourier for the mathematical background.

Note

Directly borrowed for Claude (2008), and called ifourier2 there.

References

Zahn CT, Roskies RZ. 1972. Fourier Descriptors for Plane Closed Curves. IEEE Transactions on Computers C-21: 269-281.

Claude, J. (2008) Morphometrics with R, Use R! series, Springer 316 pp.

See also

Other tfourier: tfourier_shape(), tfourier()

Examples

tfourier(bot[1], 24)
#> $ao
#> [1] 7.733739
#> 
#> $an
#>  [1]  0.0452247795 -0.3755623338  0.0276855331  0.9411732992 -0.3990148731
#>  [6] -0.7763824605 -0.5768666699  0.0440901651 -0.7604537570 -0.4636638848
#> [11] -0.6086940781 -0.1408419257 -0.2906453466  0.1360186290 -0.2905320818
#> [16] -0.0013913889  0.0999975983  0.2531539067 -0.2409440735 -0.0107735036
#> [21] -0.0386305555 -0.0238992918 -0.1631252535 -0.0004085881
#> 
#> $bn
#>  [1]  0.008457058  2.526564125 -0.554083930  0.313312077 -0.288987146
#>  [6]  0.032821965 -0.226300468  0.409651090 -0.021830547  0.015586993
#> [11]  0.414880500  0.677636372  0.197011887  0.180444429  0.433515510
#> [16]  0.237573437  0.107717915  0.027571558  0.054653201 -0.170505441
#> [21]  0.130595490 -0.014178384 -0.048221455 -0.127039009
#> 
#> $phi
#>   [1] 0.00000000 0.03394792 6.12970584 6.22607257 6.18054224 6.19051042
#>   [7] 6.13580603 5.99700591 5.99842093 5.99084704 5.86041492 5.81488459
#>  [13] 5.76506244 5.62887223 5.58334190 5.53781157 5.39732954 5.35179921
#>  [19] 5.22136709 5.16746875 5.12193843 5.06723404 5.07720222 5.03804123
#>  [25] 5.03308691 5.08250829 5.03697796 5.17966914 5.21216935 5.41953309
#>  [31] 5.77457625 5.99961627 6.05629266 6.19411028 6.06367816 6.15041823
#>  [37] 6.20005411 6.10694068 6.10899345 6.11083173 6.24864935 6.21627616
#>  [43] 0.15041122 0.41687566 0.72706839 0.84208756 0.93719564 0.93924841
#>  [49] 0.94130119 0.84818776 0.80265743 0.85207881 0.75917987 0.75672633
#>  [55] 0.62053611 0.71690284 0.62442716 0.58361378 0.52907469 0.53478153
#>  [61] 0.44702280 0.39677552 0.39819054 0.39061666 0.21281593 0.16728561
#>  [67] 0.07417217 6.26424405 6.21871372 6.07886944 5.99538267 5.94148434
#>  [73] 5.89595401 5.85879168 5.85121780 5.90000142 6.00172285 5.85652387
#>  [79] 5.95289060 6.03171526 6.08391184 6.21482206 6.12821895 6.02776111
#>  [85] 5.90179053 5.77058090 5.73820771 5.54311764 5.45064197 5.40081982
#>  [91] 5.40652666 5.31405098 5.27323760 5.21869850 5.17746000 5.13664661
#>  [97] 5.13334469 5.04086901 4.99104686 4.62111347 5.01682255 4.60719411
#> [103] 5.30626827 6.00978848 6.15257805 6.15247100 6.15452378 6.10899345
#> [109] 6.19573352 0.50480943 1.60303743 0.87544326 1.21632143 1.02825629
#> [115] 1.03030907 0.88982703 0.79735136 0.79876638 0.84818776 0.70770572
#> [121] 0.61523005 0.51420121 0.66606644 0.52558441 0.48434590 0.34125395
#> [127] 0.16219458 0.14695801 6.24944229 6.18612024 6.12136151 6.11662487
#> [133] 6.17219791 6.26019663 0.02904262 0.07417217 0.07622495 0.08278017
#> 
#> $t
#>   [1] 0.00000000 0.04553033 0.09106066 0.13659098 0.18212131 0.22765164
#>   [7] 0.27318197 0.31871230 0.36424263 0.40977295 0.45530328 0.50083361
#>  [13] 0.54636394 0.59189427 0.63742460 0.68295492 0.72848525 0.77401558
#>  [19] 0.81954591 0.86507624 0.91060657 0.95613689 1.00166722 1.04719755
#>  [25] 1.09272788 1.13825821 1.18378854 1.22931886 1.27484919 1.32037952
#>  [31] 1.36590985 1.41144018 1.45697051 1.50250083 1.54803116 1.59356149
#>  [37] 1.63909182 1.68462215 1.73015248 1.77568280 1.82121313 1.86674346
#>  [43] 1.91227379 1.95780412 2.00333445 2.04886477 2.09439510 2.13992543
#>  [49] 2.18545576 2.23098609 2.27651642 2.32204674 2.36757707 2.41310740
#>  [55] 2.45863773 2.50416806 2.54969839 2.59522871 2.64075904 2.68628937
#>  [61] 2.73181970 2.77735003 2.82288036 2.86841068 2.91394101 2.95947134
#>  [67] 3.00500167 3.05053200 3.09606233 3.14159265 3.18712298 3.23265331
#>  [73] 3.27818364 3.32371397 3.36924430 3.41477462 3.46030495 3.50583528
#>  [79] 3.55136561 3.59689594 3.64242627 3.68795659 3.73348692 3.77901725
#>  [85] 3.82454758 3.87007791 3.91560823 3.96113856 4.00666889 4.05219922
#>  [91] 4.09772955 4.14325988 4.18879020 4.23432053 4.27985086 4.32538119
#>  [97] 4.37091152 4.41644185 4.46197217 4.50750250 4.55303283 4.59856316
#> [103] 4.64409349 4.68962382 4.73515414 4.78068447 4.82621480 4.87174513
#> [109] 4.91727546 4.96280579 5.00833611 5.05386644 5.09939677 5.14492710
#> [115] 5.19045743 5.23598776 5.28151808 5.32704841 5.37257874 5.41810907
#> [121] 5.46363940 5.50916973 5.55470005 5.60023038 5.64576071 5.69129104
#> [127] 5.73682137 5.78235170 5.82788202 5.87341235 5.91894268 5.96447301
#> [133] 6.01000334 6.05553367 6.10106399 6.14659432 6.19212465 6.23765498
#> 
#> $perimeter
#> [1] 2513.886
#> 
#> $thetao
#> [1] -1.508378
#> 
#> $x1
#> [1] 37
#> 
#> $y1
#> [1] 561
#> 
tfourier_shape()

#>                 x            y
#>  [1,]  0.09561277 -0.004814825
#>  [2,]  0.17323630  0.012512711
#>  [3,]  0.24247674  0.051646046
#>  [4,]  0.29748929  0.109085359
#>  [5,]  0.33385352  0.179819356
#>  [6,]  0.34893838  0.257909706
#>  [7,]  0.34202693  0.337142828
#>  [8,]  0.31420461  0.411651714
#>  [9,]  0.26805270  0.476425605
#> [10,]  0.20721414  0.527653777
#> [11,]  0.13590836  0.562883614
#> [12,]  0.05846627  0.581004809
#> [13,] -0.02106025  0.582095153
#> [14,] -0.09918242  0.567175968
#> [15,] -0.17314294  0.537927066
#> [16,] -0.24097751  0.496404468
#> [17,] -0.30149084  0.444792525
#> [18,] -0.35417340  0.385208942
#> [19,] -0.39908549  0.319569319
#> [20,] -0.43673077  0.249508712
#> [21,] -0.46793577  0.176352003
#> [22,] -0.49374533  0.101122207
#> [23,] -0.51533859  0.024575573
#> [24,] -0.53396545 -0.052746453
#> [25,] -0.55090089 -0.130456468
#> [26,] -0.56741250 -0.208257641
#> [27,] -0.58473615 -0.285882037
#> [28,] -0.60405502 -0.363034076
#> [29,] -0.62647771 -0.439341866
#> [30,] -0.65301277 -0.514318839
#> [31,] -0.68453815 -0.587338057
#> [32,] -0.72176597 -0.657621374
#> [33,] -0.76520472 -0.724245173
#> [34,] -0.81512229 -0.786163607
#> [35,] -0.87151466 -0.842248868
#> [36,] -0.93408535 -0.891346370
#> [37,] -1.00224041 -0.932340801
#> [38,] -1.07510266 -0.964227287
#> [39,] -1.15154679 -0.986180670
#> [40,] -1.23025448 -0.997615508
#> [41,] -1.30978610 -0.998229998
#> [42,] -1.38866314 -0.988028677
#> [43,] -1.46545414 -0.967321231
#> [44,] -1.53885612 -0.936697614
#> [45,] -1.60776454 -0.896982570
#> [46,] -1.67132626 -0.849175003
#> [47,] -1.72897228 -0.794379083
#> [48,] -1.78042991 -0.733734485
#> [49,] -1.82571635 -0.668352569
#> [50,] -1.86511718 -0.599264002
#> [51,] -1.89915498 -0.527381571
#> [52,] -1.92855271 -0.453480087
#> [53,] -1.95419642 -0.378193596
#> [54,] -1.97710051 -0.302028917
#> [55,] -1.99837709 -0.225393658
#> [56,] -2.01920947 -0.148636458
#> [57,] -2.04082810 -0.072096988
#> [58,] -2.06448584  0.003836979
#> [59,] -2.09142827  0.078668531
#> [60,] -2.12285438  0.151730528
#> [61,] -2.15986277  0.222129640
#> [62,] -2.20337967  0.288702417
#> [63,] -2.25406724  0.349992107
#> [64,] -2.31221382  0.404256561
#> [65,] -2.37761297  0.449518103
#> [66,] -2.44944361  0.483665071
#> [67,] -2.52616994  0.504610845
#> [68,] -2.60548492  0.510509188
#> [69,] -2.68432347  0.500014501
#> [70,] -2.75896986  0.472563240
#> [71,] -2.82527534  0.428640136
#> [72,] -2.87898770  0.369983183
#> [73,] -2.91617419  0.299677983
#> [74,] -2.93369646  0.222098182
#> [75,] -2.92967593  0.142665876
#> [76,] -2.90387517  0.067433061
#> [77,] -2.85792168  0.002518250
#> [78,] -2.79531652 -0.046535279
#> [79,] -2.72120119 -0.075389641
#> [80,] -2.64189714 -0.081433142