Difference between revisions of "Sin"
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'>Sin </span>register, dword</span> * ''register'' = Register to write float val...") |
Pheonixmog (Talk | contribs) (→Also see) |
||
Line 24: | Line 24: | ||
==Also see== | ==Also see== | ||
− | [[particle2]], [[faddi]],[[fsubi]], [[fmuli]], [[fdivi]] | + | [[particle2]], [[faddi]], [[fsubi]], [[fmuli]], [[fdivi]] |
Latest revision as of 18:58, 5 February 2022
Contents
Syntax
Syntax: Sin 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 Sin 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 sin R1, R4 //Makes register 1 equal Sin (R4). fleti R2, 10 fleti R3, 0 fmuli R1, 20 //Multiplies the Sin 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