Engee documentation

Trigonometric Function

Page in progress.

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, .

Ports

Input

# IN_1 — input signal, rad
scalar | vector | matrix

Details

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

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Complex numbers support

Yes

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

Details

Enter the real part of the function argument for atan2.

If the parameters for . Function is set to atan2, 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 real part of the function argument.

Dependencies

In order to use this port, set the parameter Function value atan2.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

Yes

Output

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

Details

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

  • Scalar operations.

  • Elemental vector and matrix operations.

Data types

Float64.

Complex numbers support

Yes

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

Details

The cosine of the input signal in radians.

When the parameters are set to Function is set to sincos, the unit displays two input ports. The first input port (sin) is the sine value of the input signal. The second input port (cos) is the cosine value of the input signal.

Dependencies

To use this port, set the parameters to Function value sincos.

Data types

Float64.

Complex numbers support

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, input signals of the type complex They are not supported for modeling or code generation.
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 of 1 or -1 for input data outside the range 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