122
4
4 Instructions4.4.3 Trigonometric Functions
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
The cosine of the designated angle (measured in radians) is calculated. The variable is in binary oating-
point number format.
Example:
ǒDTAN D20 D30Ǔ
X2
DS
The tangent of the angle measured in radians in (D21, D20)
is calculated. The result is stored in (D31, D30).
The source data and COS operation result are in binary oating-point number format.
According to the equation Angle in radians = Angle in degrees x π/180°, an angle of 360° is converted to
radians as follows: 360° x π/180° = 2π.
For details about the programming statement for calculating the cosine in degrees, see the example
described in
“SIN: Floating point SIN operation” on Page 120
.
TAN: Floating point TAN operation
◆
Overview
The TAN instruction calculates the tangent of the designated angle (measured in radians). The variable is in
binary oating-point number format.
TAN S D
Floating point TAN
operation
Applicable model:
H3U
S Data source
Angular variable whose tangent is to be calculated, in
the unit of rad and in binary oating-point number format;
value range: 0 ≤ α < 2π
32-bit instruction
(9 steps)
DTAN:
Continuous
execution
DTANP: Pulse
execution
D
Operation
result
Tangent storage unit, in binary oating-point number
format
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.