|Home | Tutorial | Classes | Functions | QSA Workbench | Language | Qt API | QSA Articles Qt Script for Applications

[Prev: Built-in Objects] [Home] [Next: System]

Math

The Math object always exists in a Qt Script program. Use the Math object to access mathematical constants and functions, e.g.

    var x, angle, y;
    with ( Math ) {
        x = PI * 2;
        angle = 1.3;
        y = x * sin( angle );
    }

The Math object supports all the common mathematical functions, for example: abs(), acos() and cos(), asin() and sin(), atan(), atan2() and tan(), ceil(), floor() and round(), exp() and log(), max() and min(), pow() and sqrt(), random(), and round().

See also, + operator, ++ operator, - operator, -- operator, * operator, / operator, % operator, -= operator, += operator, *= operator, /= operator and %= operator.

Math Properties

All the Math properties are read-only constants.

Math Functions

[Prev: Built-in Objects] [Home] [Next: System]


Copyright © 2001-2006 TrolltechTrademarks
QSA version 1.1.5