Skip to content
ffredyk edited this page Jul 23, 2026 · 1 revision

sin

Category

Math

Arity

Unarysin <radians>.

sin <number>   // angle in radians

Description

Returns the sine of an angle given in radians. Auto-unwraps shared values.

How It Works

Calls Math.Sin(double). Input is radians, not degrees. Convert degrees to radians with _deg * pi / 180.

Usage

sin 0;                         // 0
sin 1.5708;                    // ~1 (π/2 radians = 90°)
sin 3.14159;                   // ~0 (π radians = 180°)

// Degrees to radians conversion
_rad = _deg * 3.14159265 / 180;
_s = sin _rad;

// Wave / oscillation
_y = _amplitude * sin (_frequency * _time);

// Vertical component of angle
_vy = _speed * sin _angle;

Thread Safety

ReadOnly — pure computation. Safe from any scheduler.

See Also

  • cos — cosine
  • tan — tangent
  • asin — arc sine (inverse)
  • atan2 — arc tangent (2-argument)

SQ# Wiki

Home

Engine Docs

Migration

Commands

Value Constructors

Arithmetic

Comparison

Logic

Array

String

Math

Random

Type & Introspection

HashMap

Code Execution

Concurrency

Scheduler

Thread Safety

Error

Output

Time

Multiplayer

Compiler

Clone this wiki locally