@esengine/nova-ecs-math - v1.0.5
    Preparing search index...

    Class Fixed

    Fixed-point number implementation for deterministic arithmetic 用于确定性算术的定点数实现

    Index

    Constructors

    • Create a new Fixed-point number 创建新的定点数

      Parameters

      • value: string | number | Fixed

        The value to convert to fixed-point

      Returns Fixed

    Properties

    DEG_TO_RAD: Fixed = ...
    E: Fixed = ...
    HALF: Fixed = ...
    ONE: Fixed = ...
    PI: Fixed = ...
    PI_2: Fixed = ...
    PI_4: Fixed = ...
    PI_HALF: Fixed = ...
    PI_QUARTER: Fixed = ...
    PI_TWO: Fixed = ...
    RAD_TO_DEG: Fixed = ...
    TWO: Fixed = ...
    TWO_PI: Fixed = ...
    ZERO: Fixed = ...

    Accessors

    • get rawValue(): number

      Get the raw internal value (for advanced usage) 获取原始内部值(高级用法)

      Returns number

    • get scale(): number

      Get the scale factor used for fixed-point arithmetic 获取用于定点算术的比例因子

      Returns number

    Methods

    • Add in place (modifies this instance for better performance) 就地相加(修改当前实例以提高性能)

      Parameters

      Returns Fixed

    • Calculate arcsine using Newton's method 使用牛顿法计算反正弦值

      Returns Fixed

    • Calculate arctangent using CORDIC algorithm 使用CORDIC算法计算反正切值

      Returns Fixed

    • Ceiling function - smallest integer greater than or equal to this value 向上取整函数

      Returns Fixed

    • Calculate cosine using the identity cos(x) = sin(x + π/2) 使用恒等式 cos(x) = sin(x + π/2) 计算余弦值

      Returns Fixed

    • Divide in place (modifies this instance for better performance) 就地相除(修改当前实例以提高性能)

      Parameters

      Returns Fixed

    • Check equality with another Fixed number 检查与另一个定点数是否相等

      Parameters

      Returns boolean

    • Exponential function using Taylor series 使用泰勒级数计算指数函数

      Returns Fixed

    • Floor function - largest integer less than or equal to this value 向下取整函数

      Returns Fixed

    • Check if this number is greater than another 检查是否大于另一个数

      Parameters

      Returns boolean

    • Check if this number is greater than or equal to another 检查是否大于或等于另一个数

      Parameters

      Returns boolean

    • Check if this number is less than another 检查是否小于另一个数

      Parameters

      Returns boolean

    • Check if this number is less than or equal to another 检查是否小于或等于另一个数

      Parameters

      Returns boolean

    • Natural logarithm using Taylor series 使用泰勒级数计算自然对数

      Returns Fixed

    • Modulo operation - returns the remainder after division 模运算 - 返回除法后的余数

      Parameters

      Returns Fixed

    • Multiply in place (modifies this instance for better performance) 就地相乘(修改当前实例以提高性能)

      Parameters

      Returns Fixed

    • Power function using exponentiation by squaring 使用平方求幂的幂函数

      Parameters

      Returns Fixed

    • Calculate sine using Taylor series for deterministic results 使用泰勒级数计算正弦值,确保确定性结果

      Returns Fixed

    • Calculate square root using Newton's method for deterministic results 使用牛顿迭代法计算平方根,确保确定性结果

      Returns Fixed

    • Subtract in place (modifies this instance for better performance) 就地相减(修改当前实例以提高性能)

      Parameters

      Returns Fixed

    • Convert to regular number 转换为普通数字

      Returns number

    • Convert to string representation 转换为字符串表示

      Returns string

    • Create a cached Fixed number for commonly used values 为常用值创建缓存的定点数

      Parameters

      • value: number

      Returns Fixed

    • Static cosine function using cos(x) = sin(x + π/2) 使用 cos(x) = sin(x + π/2) 的静态余弦函数

      Parameters

      Returns Fixed

    • Create a Fixed number from raw internal value 从原始内部值创建定点数

      Parameters

      • rawValue: number

      Returns Fixed

    • Static sine function using Taylor series 使用泰勒级数的静态正弦函数

      Parameters

      Returns Fixed