Learn R Programming

dual (version 0.0.5)

Trig: Trigonometric Functions

Description

These functions give the obvious trigonometric functions. They respectively compute the cosine, sine, tangent, arc-cosine, arc-sine, arc-tangent, and the two-argument arc-tangent.

cospi(x), sinpi(x), and tanpi(x), compute cos(pi*x), sin(pi*x), and tan(pi*x).

Usage

# S4 method for dual
cos(x)

# S4 method for dual sin(x)

# S4 method for dual tan(x)

# S4 method for dual acos(x)

# S4 method for dual asin(x)

# S4 method for dual atan(x)

# S4 method for dual,numeric atan2(y, x)

# S4 method for numeric,dual atan2(y, x)

# S4 method for dual,dual atan2(y, x)

# S4 method for dual cospi(x)

# S4 method for dual sinpi(x)

# S4 method for dual tanpi(x)

Value

A dual object containing the transformed values according to the chosen function.

Arguments

x

dual object or numeric value.

y

dual object or numeric value.

Examples

Run this code
x <- dual(1, 1:0)
y <- dual(1, 0:1)

cos(x)
sin(x)
tan(x)
acos(x - 0.5)
asin(x - 0.5)
atan(x - 0.5)
atan2(x, y)
atan2(2.4, y)
atan2(x, 1.2)
cospi(1.2 * x)
sinpi(3.4 * x)
tanpi(5.6 * x)

Run the code above in your browser using DataLab