Difference between revisions of "02F7"
Jump to navigation
Jump to search
(Created page with "{{Icon|trilogy}} '''COS''' <hr /> '''Description''' : Takes the cosine of the floating-point value '''Syntax''' : 02F7: [''var''] = cosine [''flt''] '''Parameter''' : [''var''...") |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | {{Icon| | + | {{OpCode |
− | + | | games = {{Icon|t}} | |
− | + | | command = COS | |
− | + | | description = Takes the cosine of the floating-point value | |
− | + | | syntax1 = 02F7: [''var''] = cosine [''flt''] | |
− | + | | p1t = [''flt''] | |
− | '' | + | | p1d = Floating-point value in degrees |
− | + | | p2t = [''var''] | |
− | + | | p2d = Variable to store the result, a floating-point value | |
− | + | | native = [[COS]] | |
− | + | }} | |
− | |||
− | |||
This opcode takes the cosine of the floating-point value in degrees and stores the result into a variable. The result will always be between ''-1.0'' and ''1.0''. Internally, the game converts the value to radians (3.1415927 × value × 0.0055555557), then takes cosine of that in radians. | This opcode takes the cosine of the floating-point value in degrees and stores the result into a variable. The result will always be between ''-1.0'' and ''1.0''. Internally, the game converts the value to radians (3.1415927 × value × 0.0055555557), then takes cosine of that in radians. | ||
== Keywords == | == Keywords == | ||
− | math, cos, cosine | + | {{K|math}}, cos, cosine |
== See also == | == See also == | ||
− | * [[02F6]], sine | + | * {{Icon|t}} [[02F6]], sine |
− | |||
− |
Latest revision as of 04:21, 20 December 2016
- Description
- Takes the cosine of the floating-point value
- Syntax
- 02F7: [var] = cosine [flt]
- Parameter
- [flt]
- Floating-point value in degrees
- [var]
- Variable to store the result, a floating-point value
- Native analog
- COS
This opcode takes the cosine of the floating-point value in degrees and stores the result into a variable. The result will always be between -1.0 and 1.0. Internally, the game converts the value to radians (3.1415927 × value × 0.0055555557), then takes cosine of that in radians.
Keywords
math, cos, cosine
See also
- 02F6, sine