cosd: Cosine (in degrees) [GNU Octave/MATLAB compatible]

cosdR Documentation

Cosine (in degrees) [GNU Octave/MATLAB compatible]

Description

Calculates the value of cosine for each element of x in degrees in a manner compatible with GNU Octave/MATLAB. Zero is returned for any 'elements where (x - 90) / 180 is an integer.' Reference: Eaton.

Usage

cosd(x)

Arguments

x

A numeric vector containing values in degrees

Value

The cosine of each element of x in degrees. Zero for any 'elements where (x - 90) / 180 is an integer.'

Note

Note: If you have a radian (rad) angle value, use cos instead.

Author(s)

David Bateman (GNU Octave cosd), Irucka Embry

Source

  1. r - How to not run an example using roxygen2? - Stack Overflow answered and edited by samkart on Jul 9 2017. (Also see the additional comments in response to the answer.) See https://stackoverflow.com/questions/12038160/how-to-not-run-an-example-using-roxygen2.

  2. devtools - Issues in R package after CRAN asked to replace dontrun by donttest - Stack Overflow answered by Hong Ooi on Sep 1 2020. (Also see the additional comments in response to the answer.) See https://stackoverflow.com/questions/63693563/issues-in-r-package-after-cran-asked-to-replace-dontrun-by-donttest.

References

  1. John W. Eaton, David Bateman, Søren Hauberg, and Rik Wehbring (November 2022). GNU Octave: A high-level interactive language for numerical computations: Edition 7 for Octave version 7.3.0. https://docs.octave.org/octave.pdf. Page 553.

  2. Wikimedia Foundation, Inc. Wikipedia, 24 February 2019, "Radian", https://en.wikipedia.org/wiki/Radian.

Examples


library(iemisc)

# Example from GNU Octave cosd

cosd(seq(0, 80, by = 10))



# See Source 1 and Source 2

library(iemisc)

try(cosd("90"))






iemisc documentation built on Sept. 25, 2023, 5:09 p.m.