Description Usage Arguments Details Value Note See Also Examples

Computes the trigonometric series.

1 | ```
trigApprox(t, x, m)
``` |

`t` |
vector of points at which to compute the values of the trigonometric approximation. |

`x` |
data from |

`m` |
degree of trigonometric regression. |

Calls `trigPoly`

to get the trigonometric coefficients and then
sums the finite series.

Vector of values the same length as `t`

.

TODO: Return an approximating function instead.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
## Not run:
## Example: Gauss' Pallas data (1801)
asc <- seq(0, 330, by = 30)
dec <- c(408, 89, -66, 10, 338, 807, 1238, 1511, 1583, 1462, 1183, 804)
plot(2*pi*asc/360, dec, pch = "+", col = "red", xlim = c(0, 2*pi), ylim = c(-500, 2000),
xlab = "Ascension [radians]", ylab = "Declination [minutes]",
main = "Gauss' Pallas Data")
grid()
points(2*pi*asc/360, dec, pch = "o", col = "red")
ts <- seq(0, 2*pi, len = 100)
xs <- trigApprox(ts ,dec, 1)
lines(ts, xs, col = "black")
xs <- trigApprox(ts ,dec, 2)
lines(ts, xs, col = "blue")
legend(3, 0, c("Trig. Regression of degree 1", "Trig. Regression of degree 2",
"Astronomical position"), col = c("black", "blue", "red"),
lty = c(1,1,0), pch = c("", "", "+"))
## End(Not run)
``` |

pracma documentation built on May 21, 2017, 1:25 a.m.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.