using System; using System.Collections.Generic; using System.Text; using Sunweaver.Commands.Attributes; namespace Sunweaver.Commands.UnaryMath { /// /// [0,2pi] scaled to [0, 1080] /// Return values scaled from [-1,1] to [-1080, 1080] /// [BasePair] public class sin : Abstracts.UnaryOperation { public override void Operation(long a) { double angle = (double)a; angle /= 1080; angle *= 2 * Math.PI; VM.Stack.Push((long)Math.Round(1080 * Math.Sin(angle))); } } }