Vortex Docs
  • Introduction
  • Getting Started
  • Language Reference
    • Core Functionality
    • Built-in Functions
    • Hooks
    • C Interoperability
    • Coroutines
    • Decorators
    • Type Hinting
    • Error Handling
  • Examples
    • Data Structures
    • Hooks
    • Fetching Data
    • Sockets
    • Event Bus
  • Standard Modules
    • Functional
    • Functools
    • Future
    • I/O
    • JSON
    • Logging
    • Math
    • OS
    • Random
    • Requests
    • SDL
    • SQLite
    • String
    • Sys
    • Time
    • Crypto
    • Websockets
  • Development Roadmap
Powered by GitBook
On this page
  1. Standard Modules

Math

The 'math' module provides math functions

Function Signatures

// Rounds a number up to the nearest integer.
const ceil = (value: Number) => Number

// Rounds a number down to the nearest integer.
const floor = (value: Number) => Number

// Returns the absolute value of a number.
const abs = (value: Number) => Number

// Returns the square root of a number.
const sqrt = (value: Number) => Number

// Returns the integer part of a number by removing any fractional digits.
const trunc = (value: Number) => Number

// Returns the natural logarithm (base e) of a number.
const log = (value: Number, base: Number) => Number

// Returns the result of raising a number to a specified power.
const pow = (value: Number, exponent: Number) => Number

// Returns the tangent of an angle.
const tan = (value: Number) => Number

// Returns the sine of an angle.
const sin = (value: Number) => Number

// Returns the cosine of an angle.
const cos = (value: Number) => Number

// Multiplies a 4-dimensional vector by a 4x4 matrix.
const multMat4 = (vec: [Number], mat: [[Number]]) => [Number]
PreviousLoggingNextOS

Last updated 1 year ago