Next Previous Up Contents
Next: Formats
Up: General Functions
Previous: CoordsDegrees

### B.1.15 Maths

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

`sin( theta )`
  Sine of an angle.
  - `theta` (floating point): an angle, in radians.
  - return value (floating point): the sine of the argument.
`cos( theta )`
  Cosine of an angle.
  - `theta` (floating point): an angle, in radians.
  - return value (floating point): the cosine of the argument.
`tan( theta )`
  Tangent of an angle.
  - `theta` (floating point): an angle, in radians.
  - return value (floating point): the tangent of the argument.
`asin( x )`
  Arc sine of an angle. The result is in the range of -pi/2 through pi/2.
  - `x` (floating point): the value whose arc sine is to be returned.
  - return value (floating point): the arc sine of the argument (radians)
`acos( x )`
  Arc cosine of an angle. The result is in the range of 0.0 through pi.
  - `x` (floating point): the value whose arc cosine is to be returned.
  - return value (floating point): the arc cosine of the argument (radians)
`atan( x )`
  Arc tangent of an angle. The result is in the range of -pi/2 through pi/2.
  - `x` (floating point): the value whose arc tangent is to be returned.
  - return value (floating point): the arc tangent of the argument (radians)
`exp( x )`
  Euler's number e raised to a power.
  - `x` (floating point): the exponent to raise e to.
  - return value (floating point): the value ex, where e is the base of the natural logarithms.
`log10( x )`
  Logarithm to base 10.
  - `x` (floating point): argument
  - return value (floating point): log10(x)
`ln( x )`
  Natural logarithm.
  - `x` (floating point): argument
  - return value (floating point): loge(x)
`sqrt( x )`
  Square root. The result is correctly rounded and positive.
  - `x` (floating point): a value.
  - return value (floating point): the positive square root of `x`. If the argument is NaN or less than zero, the result is NaN.
`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.
  - `xs` (floating point, one or more): one or more numeric values
  - return value (floating point): sqare root of sum of squares of arguments
`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.
  - `y` (floating point): the ordinate coordinate
  - `x` (floating point): the abscissa coordinate
  - return value (floating point): the `theta` component (radians) of the point (`r`,`theta`) in polar coordinates that corresponds to the point (`x`,`y`) in Cartesian coordinates.
`pow( a, b )`
  Exponentiation. The result is the value of the first argument raised to the power of the second argument.
  - `a` (floating point): the base.
  - `b` (floating point): the exponent.
  - return value (floating point): the value `ab`.
`sinh( x )`
  Hyperbolic sine.
  - `x` (floating point): parameter
  - return value (floating point): result
`cosh( x )`
  Hyperbolic cosine.
  - `x` (floating point): parameter
  - return value (floating point): result
`tanh( x )`
  Hyperbolic tangent.
  - `x` (floating point): parameter
  - return value (floating point): result
`asinh( x )`
  Inverse hyperbolic sine.
  - `x` (floating point): parameter
  - return value (floating point): result
`acosh( x )`
  Inverse hyperbolic cosine.
  - `x` (floating point): parameter
  - return value (floating point): result
`atanh( x )`
  Inverse hyperbolic tangent.
  - `x` (floating point): parameter
  - return value (floating point): result
`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: Formats
Up: General Functions
Previous: CoordsDegrees

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