Trigonometric Function
Specified trigonometric function on input
 Library:
Simulink / Math Operations
HDL Coder / Math Operations
Description
The Trigonometric Function block performs common trigonometric functions and outputs the result in rad or rev.
Supported Functions
You can select one of these functions from the Function parameter list.
Function  Description  Mathematical Expression  MATLAB^{®} Equivalent 

sin
 Sine of the input 

sin

cos
 Cosine of the input 

cos

tan
 Tangent of the input 

tan

asin
 Inverse sine of the input 

asin

acos
 Inverse cosine of the input 

acos

atan
 Inverse tangent of the input 

atan

atan2
 Fourquadrant inverse tangent of the input 

atan2

sinh
 Hyperbolic sine of the input 

sinh

cosh
 Hyperbolic cosine of the input 

cosh

tanh
 Hyperbolic tangent of the input 

tanh

asinh
 Inverse hyperbolic sine of the input 

asinh

acosh
 Inverse hyperbolic cosine of the input 

acosh

atanh
 Inverse hyperbolic tangent of the input 

atanh

sincos
 Sine of the input; cosine of the input  —  — 
cos + jsin
 Complex exponential of the input  —  — 
CORDIC Approximation Method
CORDIC is an acronym for COordinate Rotation DIgital Computer. The Givens rotationbased CORDIC algorithm is one of the most hardwareefficient algorithms available because it requires only iterative shiftadd operations. For more information, see More About. The block input has further requirements.
For more information on when you set Function to
sin
, cos
, sincos
, or
cos + jsin
and set the Approximation
method to CORDIC
, see Port_1.
This table summarizes what happens for an invalid input.
Block Usage  Effect of Invalid Input 

Simulation modes  An error appears. 
Generated code  Undefined behavior occurs. Avoid relying on undefined behavior for generated code. 
Lookup Approximation Method
For more information on when you set Function to
sin
, cos
, sincos
,
or cos + jsin
and set the Approximation method
to Lookup
, see Port_1.
Ports
Input
Output
Parameters
Model Examples
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

^{[a]} This block supports fixedpoint and base integer data types for 'Approximation method' CORDIC. 
More About
References
[1] Volder, Jack E., “The CORDIC Trigonometric Computing Technique.” IRE Transactions on Electronic Computers EC8 (1959); 330–334.
[2] Andraka, Ray “A Survey of CORDIC Algorithm for FPGA Based Computers.” Proceedings of the 1998 ACM/SIGDA Sixth International Symposium on Field Programmable Gate Arrays. Feb. 22–24 (1998): 191–200.
[3] Walther, J.S., “A Unified Algorithm for Elementary Functions,” Proceedings of the Spring Joint Computer Conference, May 1820, 1971: 379–386.
[4] Schelin, Charles W., “Calculator Function Approximation,” The American Mathematical Monthly 90, no. 5 (1983): 317–325.
Extended Capabilities
See Also
Blocks
Functions
cordicsin
(FixedPoint Designer) cordiccos
(FixedPoint Designer) cordicsincos
(FixedPoint Designer)