Functions
Functions
Graphics » HAL GFX » GFX MATH
Collaboration diagram for Functions:

## Functions
float | hal_gfx_sin (float angle_degrees)
| Fast sine approximation of a given angle. More...
float | hal_gfx_cos (float angle_degrees)
| Fast cosine approximation of a given angle. More...
float | hal_gfx_tan (float angle_degrees)
| Fast tangent approximation of a given angle. More...
float | hal_gfx_pow (float x, float y)
| A rough approximation of x raised to the power of y. More...
float | hal_gfx_sqrt (float x)
| A rough approximation of the square root of x. More...
float | hal_gfx_atan (float x)
| A floating-point approximation of the inverse tangent of x. More...
int | hal_gfx_f2fx (float f)
| Convert float to 16.16 fixed point. More...

## Detailed Description

## Function Documentation

## ◆ hal_gfx_atan()

float hal_gfx_atan | ( | float | x | ) |

A floating-point approximation of the inverse tangent of x.

Parameters

  [in] | x | X value

Returns
  Inverse tangent (angle) of x in degrees

## ◆ hal_gfx_cos()

float hal_gfx_cos | ( | float | angle_degrees | ) |

Fast cosine approximation of a given angle.

Parameters

  [in] | angle_degrees | Angle in degrees

Returns
  Cosine of the given angle

## ◆ hal_gfx_f2fx()

int hal_gfx_f2fx | ( | float | f | ) |

Convert float to 16.16 fixed point.

Parameters

  [in] | f | Value to be converted

Returns
  16.16 fixed point value

## ◆ hal_gfx_pow()

float hal_gfx_pow | ( | float | x,
|  | float | y
| ) |  |

A rough approximation of x raised to the power of y.

USE WITH CAUTION!

Parameters

  [in] | x | base value. Must be non negative.
  [in] | y | power value

Returns
  The result of raising x to the power y

## ◆ hal_gfx_sin()

float hal_gfx_sin | ( | float | angle_degrees | ) |

Fast sine approximation of a given angle.

Parameters

  [in] | angle_degrees | Angle in degrees

Returns
  return Sine of the given angle

## ◆ hal_gfx_sqrt()

float hal_gfx_sqrt | ( | float | x | ) |

A rough approximation of the square root of x.

USE WITH CAUTION!

Parameters

  [in] | x | X value. Must be non negative

Returns
  The square root of x

## ◆ hal_gfx_tan()

float hal_gfx_tan | ( | float | angle_degrees | ) |

Fast tangent approximation of a given angle.

Parameters

  [in] | angle_degrees | Angle in degrees

Returns
  Tangent of the given angle