Resolution independent 2D graphics engine
qr::math

Class Description

General math functions.

Public Methods

float smalest_largest (float *values, int total, int sma_lar)
float angle_from_vectors (vector2d_f P0, vector2d_f P1)
vector2d_f lin_interp (vector2d_f P0, vector2d_f P1, float pos)
vector2d_f bezier (vector2d_f P[4], float crv_pos)

Details

float qr::math::smalest_largest ( float * values,
int total,
int sma_lar
) [static]

Description

Find the smallest or largest value in a range of floats.

Retunes

The smallest or largest value in the range.

Paramiters

values An array of floating point numbers.
total The total number of values.
sma_lar Switch to set weather the smallest or largest value is found. Takes qr::SMALLEST or qr::LARGEST.
float qr::math::angle_from_vectors ( vector2d_f P0,
vector2d_f P1
) [static]

Description

Calculates the angle between 2 vectors.

Retunes

The angle between the 2 vectors in degrees.

Paramiters

P0 Vector 1.
P1 Vector 2.
vector2d_f qr::math::lin_interp ( vector2d_f P0,
vector2d_f P1,
float pos
) [static]

Description

Linear interpolates between 2 vectors.

Retunes

Interpolated vector.

Paramiters

P0 Vector 1.
P1 Vector 2.
pos Position between the vectors.
vector2d_f qr::math::bezier ( vector2d_f P,
float crv_pos
) [static]

Description

Calculates a point on a quadratic bazier curve.

Retunes

Bezier point.

Paramiters

P Array of 4 control vectors.
crv_pos Curve position, value between 0 and 1.