Learn R Programming

Tex4exams (version 0.1.2)

costex: Triangle leg values to TeX code of the cosine value

Description

Convert a cosine value into TeX code with simplification on the radical from the hypotenuse, where the input (a,b) are the integer lengths of the legs of the right triangle with a the vertical leg, b the horizontal leg. The simplification is provided by another function 'simpRad' in the same package.

Usage

costex(a,b)

Value

The function returns a string of TeX code for the value of the associated cosine.

Arguments

a

The vertical length of the right triangle, which can be negative.

b

The horizontal length of the right triangle, which can be negative.

Details

Given integer lengths of a the legs of a triangle, the function returns a string of tex code for the value of the associated cosine.

See Also

sintex,simpRad

Examples

Run this code
a <- sample(c(1:5),1)
b <- sample(c(1:5),1)

costex(a,b)

Run the code above in your browser using DataLab