Math Class Reference

#include <Math.h>

Inheritance diagram for Math:
Object

# Static Public Member Functions

static int32 abs (int32 number)
static float floor (float number)
static int32 min (int32 a, int32 b)
static int32 max (int32 a, int32 b)
static float squareRoot (float radicand)
static fixed_t squareRootFixed (fixed_ext_t radicand)
static uint32 randomSeed ()
static int32 random (uint32 seed, int32 range)
static int32 haveEqualSign (int32 a, int32 b)
static int32 getDigitsCount (int32 number)
static void resetRandomSeed ()
 Reset the internal random seed.
static int32 intInfinity ()
static fixed_t fixedInfinity ()
static fixed_ext_t fixed_extInfinity ()
static int32 aSin (fix7_9 sin)
static int32 getAngle (fix7_9 x, fix7_9 y)
static int32 power (int32 base, int32 power)
static int32 powerFast (int32 base, int32 power)

# Additional Inherited Members

- Private Member Functions inherited from Object
void constructor ()
 Class' constructor.
const void * getVTable ()
bool mutateTo (const void *targetClass)
- Static Private Member Functions inherited from Object
static Object getCast (void *object, ClassPointer targetClassGetClassMethod, ClassPointer baseClassGetClassMethod)
- Private Attributes inherited from Object
void * vTable
 Pointer to the class's virtual table.

# Detailed Description

Class Math

Inherits from Object

Implements miscelaneous mathematical functions.

Definition at line 326 of file Math.h.

# Member Function Documentation

# abs()

static int32 Math::abs ( int32 number)
inlinestatic

Compute the absolute value of number.

Parameters
numberInput number to compute the absolute value of
Returns
Absolute value of the provided number

# aSin()

static int32 Math::aSin ( fix7_9 sin)
static

Compute the arc sin of the provided sin.

Parameters
sinsin value
Returns
Arcsin of the provided sin value

Definition at line 140 of file Math.c.

# fixed_extInfinity()

static fixed_ext_t Math::fixed_extInfinity ( )
static

Retrieve the maximum number for the fixed_ext_t data type.

Returns
Maximum positive value for the fixed_ext_t data type

Definition at line 133 of file Math.c.

# fixedInfinity()

static fixed_t Math::fixedInfinity ( )
static

Retrieve the maximum number for the fixed_t data type.

Returns
Maximum positive value for the fixed_t data type

Definition at line 126 of file Math.c.

# floor()

static float Math::floor ( float number)
inlinestatic

Round down the provided number.

Parameters
numberInput number to round down
Returns
Integral part of the provided number

Definition at line 446 of file Math.h.

# getAngle()

static int32 Math::getAngle ( fix7_9 x,
fix7_9 y )
static

Compute the angle between (0, 0) and (x, y).

Parameters
xX coordinate
yY coordinate
Returns
Angle in degrees (0-512)

Definition at line 165 of file Math.c.

# getDigitsCount()

static int32 Math::getDigitsCount ( int32 number)
inlinestatic

Compute the number of digits that the provided number has.

Parameters
numberNumber to compute the digits of
Returns
Number of digits of the provided number

Definition at line 542 of file Math.h.

# haveEqualSign()

static int32 Math::haveEqualSign ( int32 a,
int32 b )
inlinestatic

Check if the provided numbers have equal sign.

Parameters
aFirst number
bSecond number
Returns
True if the provided numbers have equal sign; false otherwise

Definition at line 535 of file Math.h.

# intInfinity()

static int32 Math::intInfinity ( )
static

Retrieve the maximum number for the int32 data type.

Returns
Maximum positive value for the int32 data type

Definition at line 119 of file Math.c.

# max()

static int32 Math::max ( int32 a,
int32 b )
inlinestatic

Return the maximum number between two numbers.

Parameters
aFirst number
bSecond number
Returns
Maximum number between those provided

Definition at line 460 of file Math.h.

# min()

static int32 Math::min ( int32 a,
int32 b )
inlinestatic

Return the minimum number between two numbers.

Parameters
aFirst number
bSecond number
Returns
Minimum number between those provided

Definition at line 453 of file Math.h.

# power()

static int32 Math::power ( int32 base,
int32 power )
static

Compute the power for the provided base.

Parameters
baseBase
powerPower
Returns
Base elevated to the provided power

Definition at line 268 of file Math.c.

# powerFast()

static int32 Math::powerFast ( int32 base,
int32 power )
static

Compute the power for the provided base.

Parameters
baseBase
powerPower
Returns
Base elevated to the provided power

Definition at line 275 of file Math.c.

# random()

static int32 Math::random ( uint32 seed,
int32 range )
inlinestatic

Compute a pseudo random number from the seed in the provided range.

Parameters
seedRandom seed
rangeRange for the generated pseudo random number
Returns
The square root of the provided number

Definition at line 523 of file Math.h.

# randomSeed()

static uint32 Math::randomSeed ( )
inlinestatic

Retrieve a random seed (algorithm taken from https://www.youtube.com/watch?v=RzEjqJHW-NU).

Returns
Random seed

Definition at line 513 of file Math.h.

# resetRandomSeed()

static void Math::resetRandomSeed ( )
static

Reset the internal random seed.

Definition at line 112 of file Math.c.

# squareRoot()

static float Math::squareRoot ( float radicand)
inlinestatic

Compute the square root of the provided number (alrogithm takem from the DOOM's engine).

Parameters
radicandNumber to compute the square root of
Returns
The square root of the provided number

Definition at line 467 of file Math.h.

# squareRootFixed()

static fixed_t Math::squareRootFixed ( fixed_ext_t radicand)
inlinestatic

Compute the square root of the provided number (alrogithm takem from the DOOM's engine).

Parameters
radicandNumber to compute the square root of
Returns
The square root of the provided number

Definition at line 485 of file Math.h.


The documentation for this class was generated from the following files:
  • VUEngine-Core/source/Misc/Math/Math.h
  • VUEngine-Core/source/Misc/Math/Math.c