Difference between revisions of "Cos"
From Unofficial QEdit Wiki Guide
Pheonixmog (Talk | contribs) (Created page with "==Syntax== ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:red'>Cos </span>register, dword</span> * ''register'' = Register to write float val...") |
(No difference)
|
Revision as of 03:24, 3 February 2022
Contents
Syntax
Syntax: Cos register, dword
- register = Register to write float value to.
- dword = Angle input. The value is decimal 0 - 65535. Can also be a register.
Use
Applies the trig function Cos using an angle. The value will be between -1 and 1.
You can then apply arithmetic to modify its amplitude (fmuli/fdivi) and center (faddi/fsubi).
Example
100: leti R4, 00000000 //Makes register 4 equal 0, defaulting to 0 degrees 101: sync cos R1, R4 //Makes register 1 equal Cos (R4). fleti R2, 10 fleti R3, 0 fmuli R1, 20 //Multiplies the Cos output by 20. addi R4, 182 //Increases R4 by 182 (1 degree) particle2 R1, 000001AC, 1 //Spawns a Demons symbol for 1 frame that will rotate on the X-coord axis between -20 and 20. jmp 101