Open In App

Trigonometric Functions in MATLAB

In this article, we are going to discuss trigonometric functions and their types in MATLAB. Trigonometric functions are the mathematical functions that can result in the output with the given input. 

There are six trigonometric functions –



  1. Sine (sin)
  2. Cosine(cos)
  3. Tangent(tan)
  4. CoTangent(cot)
  5. Secant(sec)
  6. CoSecant(csc)

Sine Function

Syntax: sin(value)

Syntax: sind(value)



Syntax: asin(x)

Syntax: asind(x)

Syntax: sinh(x)

Syntax: asinh(x)

Example:




% input value is x which is initialized
% as 34
x=34
  
% compute sin(x)
sin(x)
  
% compute sind(x)
sind(x)
  
% compute asin(x)
asin(x)
  
% compute asind(x)
asind(x)
  
% compute sinh(x)
sinh(x)
  
% compute asinh(x)
asinh(x)

Output:

Cosine Function

Syntax: cos(value)

where value is the input value.

Syntax: cosd(value)

Syntax: acos(x)

Syntax: acosd(x)

Syntax: cosh(x)

Syntax: acosh(x)

Example:




% input value is x which is initialized as 58
x=58
  
% compute cos(x)
cos(x)
  
% compute cosd(x)
cosd(x)
  
% compute acos(x)
acos(x)
  
% compute acosd(x)
acosd(x)
  
% compute cosh(x)
cosh(x)
  
% compute acosh(x)
acosh(x)

Tangent Function

Syntax: tan(value)

where value is the input value

Syntax: tand(value)

Syntax: atan(x)

Syntax: atand(x)

Syntax: tanh(x)

Syntax: atanh(x)

Example:




% input value is x which is initialized as 68
x=68
  
% compute tan(x)
tan(x)
  
% compute tand(x)
tand(x)
  
% compute atan(x)
atan(x)
  
% compute atand(x)
atand(x)
  
% compute tanh(x)
tanh(x)
  
% compute atanh(x)
atanh(x)

Cotangent Function

Syntax: cot(value)

where value is the input value

Syntax: cotd(value)

Syntax: acot(x)

Syntax: acotd(x)

Syntax: coth(x)

Syntax: acoth(x)

Example:




% input value is x which is initialized as 45
x=45
  
% compute cot(x)
cot(x)
  
% compute cotd(x)
cotd(x)
  
% compute acot(x)
acot(x)
  
% compute acotd(x)
acotd(x)
  
% compute coth(x)
coth(x)
  
% compute acoth(x)
acoth(x)

Secant Function

Syntax: sec(value)

where value is the input value

Syntax: secd(value)

Syntax: asec(x)

Syntax: asecd(x)

Syntax: sech(x)

Syntax: asech(x)

 Example:




% input value is x which is initialized as 89
x = 89
  
% compute sec(x)
sec(x)
  
% compute secd(x)
secd(x)
  
% compute asec(x)
asec(x)
  
% compute asecd(x)
asecd(x)
  
% compute sech(x)
sech(x)
  
% compute asech(x)
asech(x)

CoSecant Function

Syntax: csc(value)

 where value is the input value

Syntax: cscd(value)

Syntax: acsc(x)

Syntax: acscd(x)

Syntax: csch(x)

Syntax: acsch(x)




% input value is x which is initialized as 13
x = 13
  
% compute csc(x)
csc(x)
  
% compute cscd(x)
cscd(x)
  
% compute acsc(x)
acsc(x)
  
% compute acscd(x)
acscd(x)
  
% compute csch(x)
csch(x)
  
% compute acsch(x)
acsch(x)


Article Tags :