Next Previous Up Contents
Next: Strings
Up: General Functions
Previous: Lists

B.1.13 Maths

Standard mathematical and trigonometric functions. Trigonometric functions work with angles in radians.

sin( theta )
Sine of an angle.

cos( theta )
Cosine of an angle.

tan( theta )
Tangent of an angle.

asin( x )
Arc sine of an angle. The result is in the range of -pi/2 through pi/2.

acos( x )
Arc cosine of an angle. The result is in the range of 0.0 through pi.

atan( x )
Arc tangent of an angle. The result is in the range of -pi/2 through pi/2.

exp( x )
Euler's number e raised to a power.

log10( x )
Logarithm to base 10.

ln( x )
Natural logarithm.

sqrt( x )
Square root. The result is correctly rounded and positive.

square( x )
Raise to the power 2.

hypot( xs, ... )
Returns the square root of the sum of squares of its arguments. In the 2-argument case, doing it like this may avoid intermediate overflow or underflow.

atan2( y, x )
Converts rectangular coordinates (x,y) to polar (r,theta). This method computes the phase theta by computing an arc tangent of y/x in the range of -pi to pi.

pow( a, b )
Exponentiation. The result is the value of the first argument raised to the power of the second argument.

sinh( x )
Hyperbolic sine.

cosh( x )
Hyperbolic cosine.

tanh( x )
Hyperbolic tangent.

asinh( x )
Inverse hyperbolic sine.

acosh( x )
Inverse hyperbolic cosine.

atanh( x )
Inverse hyperbolic tangent.

E
Euler's number e, the base of natural logarithms.

PI
Pi, the ratio of the circumference of a circle to its diameter.

Infinity
Positive infinite floating point value.

NaN
Not-a-Number floating point value. Use with care; arithmetic and logical operations behave in strange ways near NaN (for instance, NaN!=NaN). For most purposes this is equivalent to the blank value.

RANDOM
Evaluates to a random number in the range 0<=x<1. This is different for each cell of the table. The quality of the randomness may not be particularly good.


Next Previous Up Contents
Next: Strings
Up: General Functions
Previous: Lists

TOPCAT - Tool for OPerations on Catalogues And Tables
Starlink User Note253
TOPCAT web page: http://www.starlink.ac.uk/topcat/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk