Retro Rocket Kernel BASIC-Powered Operating System

Functions
maths.h File Reference
`#include "kernel.h"`

## Functions
double | pow (double base, double exp)
| Raise base to the power of exp. More...
double | factorial (int n)
| Calculate factorial (n!) More...
double | sin (double rads)
| Calculate sine of rads, using a lookup table. More...
double | cos (double rads)
| Calculate cosine of rads, using a lookup table. More...
double | tan (double rads)
| Calculate tangent of rads, using sin x / cos x. More...
double | sqrt (double x)
| Calculate square root of x. More...

## Detailed Description

Author
  Craig Edwards (craig.nosp@m.edwa.nosp@m.rds@b.nosp@m.rain.nosp@m.box.c.nosp@m.c)

Copyright
  Copyright (c) 2012-2023

## Function Documentation

## ◆ cos()

double cos | ( | double | rads | ) |

Calculate cosine of rads, using a lookup table.

Parameters

  rads | radians

Returns
  double cosine of radians

## ◆ factorial()

double factorial | ( | int | n | ) |

Calculate factorial (n!)

Note
  This function is not recursive, but will take O(n) time to calculate based on the integer value of n.

Parameters

  n | number to factorialise

Returns
  double n!

## ◆ pow()

double pow | ( | double | base,
|  | double | exp
| ) |  |

Raise base to the power of exp.

Parameters

  base | Base number
  exp | Exponent

Returns
  double base ** exp

## ◆ sin()

double sin | ( | double | rads | ) |

Calculate sine of rads, using a lookup table.

Parameters

  rads | radians

Returns
  double sine of radians

## ◆ sqrt()

double sqrt | ( | double | x | ) |

Calculate square root of x.

Parameters

  x | the number whose square root is to be calculated

Returns
  double calculated square root of `x`

## ◆ tan()

double tan | ( | double | rads | ) |

Calculate tangent of rads, using sin x / cos x.

Parameters

  rads | radians

Returns
  double tangent of radians