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

B.1.15 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.

ln( x )
Natural logarithm.

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

log10( x )
Logarithm to base 10.

exp10( x )
Power of 10. This convenience function is identical to pow(10,x).

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.

symlog( linthresh, linscale, x )
Symmetric logarithm mapping function. This function is not generally of much mathematical use, but it is available as one of the scaling options for plot axes. It is linear near the origin (abs(x)<=linthresh) and positive/negative logarithmic outside that region.

The function is:

    |x| <= linthresh:
         x * linscale / linthresh
    |x| >= linthresh:
         sgn(x) * (linscale + log10(|x|) - log10(linthresh))
 

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.


Next Previous Up Contents
Next: Randoms
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