# Extension:MathStatFunctions

MediaWiki extensions manual
MathStatFunction

Release status: beta

Implementation Parser function
Description Addition of math-specific and statistic specific parser functions.
Author(s) Carl Fürstenberg (AzaTothtalk)
MediaWiki > 1.8

Translate the MathStatFunctions extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

MathStatFunctions is a MediaWiki extension that is a collection of Math and Statistical functions.

## Functions

This module defines the following functions: {{ #const: key }}, {{ #mean: expr|expr|... }}, {{ #median: expr|expr|... }}, {{ #tan: expr }}, {{ #atan: expr }}, {{ #tanh: expr }} ,{{ #atanh: expr }}, {{ #cot: expr }}, {{ #cos: expr }}, {{ #acos: expr }}, {{ #cosh: expr }}, {{ #acosh: expr }}, {{ #sec: expr }}, {{ #sin: expr }}, {{ #asin: expr }}, {{ #sinh: expr }}, {{ #asinh: expr }}, {{ #csc: expr }}, {{ #ln: expr }}, {{ #log: expr }}, {{ #exp: expr }}, {{ #acot: expr }}, {{ #acsc: expr }}, {{ #asec: expr }}

### #const:

```{{ #const: key }}
```

returns the constant based on a key, which are:

• pi
• pi/2
• pi/4
• 1/pi
• 2/pi
• sqrt(pi)
• 2/sqrt(pi)
• e
• log_2(e)
• log_10(e)
• ln(2)
• ln(10)
• sqrt(2)
• sqrt(10)
• 1/sqrt(2) or sqrt(1/2)
• ln(pi)
• euler
• brion

### statistical functions

#### #mean:

```{{ #mean: expr|expr|... }}
```

Calculates the mean value of given expressions

#### #median:

```{{ #median: expr|expr|... }}
```

Calculates the median value of given expressions

### trigonometric functions

#### #tan:

```{{ #tan: expr }}
```

Calculates the tangents of given expression

#### #cot:

```{{ #cot: expr }}
```

Calculates the cotangents of given expression

#### #acot:

```{{ #acot: expr }}
{{ #arccot: expr }}
```

Calculates the arccotangents of given expression

#### #atan:

```{{ #atan: expr }}
{{ #arctan: expr }}
```

Calculates the arctangents of given expression

#### #tanh:

```{{ #tanh: expr }}
```

Calculates the hyperbolic tangents of given expression

#### #atanh:

```{{ #atanh: expr }}
{{ #arctanh: expr }}
```

Calculates the hyperbolic arctangents of given expression

#### #cos:

```{{ #cos: expr }}
```

Calculates the cosinus of given expression

#### #sec:

```{{ #sec: expr }}
```

Calculates the secant of given expression

#### #asec:

```{{ #asec: expr }}
{{ #arcsec: expr }}
```

Calculates the arcsecant of given expression

#### #acos:

```{{ #acos: expr }}
{{ #arccos: expr }}
```

Calculates the arccosinus of given expression

#### #cosh:

```{{ #cosh: expr }}
```

Calculates the hyperbolic cosinus of given expression

#### #acosh:

```{{ #acosh: expr }}
{{ #arccosh: expr }}
```

Calculates the hyperbolic arccosinus of given expression

#### #sin:

```{{ #sin: expr }}
```

Calculates the sinus of given expression

#### #csc:

```{{ #csc: expr }}
```

Calculates the cosecant of given expression

#### #acsc:

```{{ #acsc: expr }}
{{ #arccsc: expr }}
```

Calculates the arccosecant of given expression

#### #asin:

```{{ #asin: expr }}
{{ #arcsin: expr }}
```

Calculates the arcsinus of given expression

#### #sinh:

```{{ #sinh: expr }}
```

Calculates the hyperbolic sinus of given expression

#### #asinh:

```{{ #asinh: expr }}
{{ #arcsinh: expr }}
```

Calculates the hyperbolic arcsinus of given expression

### logarithmic and exponential functions

#### #ln:

```{{ #ln: expr }}
```

Calculates the natural logarithm of given expression

#### #log:

```{{ #log: expr }}
```

Calculates the logarithm in base 10 for given expression

```{{ #log: expr|base }}
```

Calculates the logarithm in base base for given expression

#### #exp:

```{{ #exp: expr }}
```

Calculates the value of $e^{expr}$

## Installation

Requires MediaWiki 1.8 or later, also requires an active installation of ParserFunctions

Download both the files and put them in a new directory called MathStatFunctions in your extensions directory.

The MathStatFunctions extension requires MediaWiki 1.8 or above.

Then put the following at the end of your LocalSettings.php:

```require_once( "\$IP/extensions/MathStatFunctions/MathStatFunctions.php" );
```