Engee documentation

Trigonometric Function

Applies a trigonometric function to the input signal.

blockType: Trigonometry

Path in the library:

/Basic/Math Operations/Trigonometric Function

Description

Block Trigonometric Function performs general trigonometric functions.

Supported functions

The applied function is set by the parameter Function:

  • sin — the sine, ;

  • cos — cosine, ;

  • tan — tangent, ;

  • asin — arcsinus, ;

  • acos — arccosine, ;

  • atan — arctangent, ;

  • atan2 — four-quadrant arctangent, ;

  • sinh — hyperbolic sine, ;

  • cosh — hyperbolic cosine, ;

  • tanh — hyperbolic tangent, ;

  • asinh — hyperbolic arcsinus, ;

  • acosh — hyperbolic arccosine, ;

  • atanh — hyperbolic arctangent, ;

  • sincos — the sine, , and the cosine, ;

  • cos + jsin — comprehensive exhibitor, .

Ports

Input

# IN_1 — Input signal, rad
scalar | vector | the matrix

Details

The input signal is in the form of a scalar, vector or matrix. Values are considered to be expressed in radians.

Data types

Float16, Float32, Float64

Complex numbers support

Yes

# IN_2 — the valid part of the function argument for atan2
scalar | vector | the matrix

Details

Enter the valid part of the function argument for atan2.

If for the parameter Function the value is set atan2, then the block shows two input ports. The first input port (In_1) is the imaginary part of the function argument. The second input port (In_2) is the valid part of the function argument.

Dependencies

To use this port, set the parameter Function value atan2.

Data types

Float16, Float32, Float64

Complex numbers support

Yes

Output

# OUT_1 — the specified trigonometric function of the input signal
scalar | vector | the matrix

Details

The result of applying the specified trigonometric function to the input signal (in radians). Each function supports:

  • Scalar operations;

  • Element-wise vector and matrix operations.

Data types

Float16, Float32, Float64

Complex numbers support

Yes

# cos — cosine of the input signal
scalar | vector | the matrix

Details

The cosine of the input signal in radians.

If for the parameter Function the value is set sincos, then the block shows two output ports. First output port (sin) is the sine value of the input signal. Second output port (cos) is the cosine value of the input signal.

Dependencies

To use this port, set the parameter Function value sincos.

Data types

Float16, Float32, Float64

Complex numbers support

Yes

# sin is the sine of the input signal

+ scalar | vector | the matrix

Details

The sine of the input signal in radians.

If for the parameter Function the value is set sincos, then the block shows two output ports. The first output port (sin) is the value of the sine of the input signal. Second output port (cos) is the cosine value of the input signal.

Dependencies

To use this port, set the parameter Function meaning sincos.

Data types

Float64

Support for complex numbers

Yes

Parameters

Parameters

# Function — the trigonometric function
sin | cos | tan | asin | acos | atan | atan2 | sinh | cosh | tanh | asinh | acosh | atanh | sincos | cos + jsin

Details

Sets the trigonometric function. The name of the function on the block icon changes according to the selected function.

Values

sin | cos | tan | asin | acos | atan | atan2 | sinh | cosh | tanh | asinh | acosh | atanh | sincos | cos + jsin

Default value

sin

Program usage name

Operator

Tunable

No

Evaluatable

No

# Output signal type — type of output signal
auto | real | complex

Details

Specify the type of output signal in the block Trigonometric Function how auto, real or complex.

Function

Input signal type

Output signal type

Auto

Real

Complex

Any choice for the parameter Function

real

real

real

complex

complex

complex

error

complex

If for the parameter Trigonometric Function the value is set atan2 or cos + jsin, input signals of the type complex They are not supported for modeling or code generation. In addition, for the value cos + jsin with an input signal like real type output signal real it will show an error.
Values

auto | real | complex

Default value

auto

Program usage name

OutputSignalType

Tunable

No

Evaluatable

No

# Remove protection against out-of-range input — disable protection against input values outside the range
Logical

Details

For acos and asin select this option to disable protection against input values outside the range, which reduces redundancy.

  • When this option is unchecked, the protection is activated. The block sets the values for input data outside the range 1 or -1 before performing any operation. The generated code contains code for checking input values that are out of range.

  • When this option is selected, the protection is disabled. The block performs all operations with the input data without any changes. The generated code does not contain any code for checking input values outside the range.

Checking this box can eliminate redundancy if the input data is already within the range.

Dependencies

To use this parameter, set for the parameter Function meaning acos and asin.

Default value

false (switched off)

Program usage name

RemoveProtectionAgainstOutOfRangeInput

Tunable

No

Evaluatable

No

Additional options

C code generation: Yes