lettura simple

Trigonometric functions in Octave

In this lesson I'll explain how to calculate trigonometric functions in Octave with some practical examples.

The trigonometric functions of sine, cosine, tangent, cotangent have as argument x an angle expressed in radians. For example, 90° is written π/2 in radians. An entire 360° round angle is equal to 2π, etc. The inverse trigonometric functions arcsine, arccosine, arctangent, arccotangent take the sine, cosine, and tangent value as arguments.

Sine

To calculate the sine of an angle x type the function sin(x)

>> sin(pi/4)
ans = 0.70711

Arcsine

The inverse function of sine is the arcsine asin(y)

>> asin(0.70711)
ans = 0.78540

The arcsine function returns the angle in radians. It is exactly the decimal value of π/4 $$ \frac{\pi}{4} = 0.78540 $$

Cosine

To calculate the cosine of an angle x use the function cos(x)

>> cos(pi/3)
ans = 0.50000

Arccosine

The inverse function of cosine is arcsine acos(y)

>> acos(0.5)
ans = 1.0472

The arcsine function returns the angle in radians that determines the cosine value y=0.5. $$ \frac{\pi}{3} = 1.0472 $$

Tangent

To calculate the tangent of an angle x type tan(x)

>> tan(pi/4)
ans = 1.00000

Arctangent

The inverse function of the tangent is the arc tangent atan(y)

>> atan(1)
ans = 0.78540

The arctangent function returns the angle in radians that determines the y=1 value of the tangent. $$ \frac{\pi}{4} = 0.78540 $$

Cotangent

To calculate the cotangent of an angle x type cot(x)

>> cot(pi/4)
ans = 1.0000

Arccotangent

The inverse function of the cotangent is the arccotangent acot(y)

>> acot(1)
ans = 0.78540

The arccotangent function returns the angle in radians that determines the y=1 value of the cotangent. $$ \frac{\pi}{4} = 0.78540 $$

Secant

To calculate the secant of an angle x type sec(x)

>> sec(0)
ans = 1

Arcsecant

The inverse function of the secant is the arc secant asec(y)

>> asec(1)
ans = 0

The arcsecant function returns the angle in radians x=0 that determines the value y=1 of the secant

Cosecant

To calculate the cosicant of an angle x type csc(x)

>> csc(0.5)
ans = 2.0858

Arccosecant

The inverse function of the cosecant is the arc cosecant acsc(y)

>> acsc(2.0858)
ans = 0.50000

The arccosecunt function returns the angle in radians x=0.5 that determines the value y=2.0858 of the cosecant.




Report a mistake or post a question




FacebookTwitterLinkedinLinkedin