API Reference › Math › Math.sin
method

Math.sin

Math.sin(radians) -> fixed

Returns the sine of radians as a fixed in -1.0..1.0. It is table-driven (a 256-entry Q16.16 sine table with linear interpolation) so it is fast and fully deterministic. Angles wrap, so any value works — no need to reduce into a range first. Pair it with Math.cos to turn an angle into a direction.

Example

program Demo {
  handler Step phase Update {
    let y = center_y + Math.sin(angle) * radius
  }
}
← All symbols