Module dlib.math.utils

Utility math functions

Functions

NameDescription
allIsZero() If all elements are zeros
bigEndian(value) Byte operations
degtorad(angle) Convert degrees to radians
fovXfromY(yfov, aspectRatio) Field of view angle X from Y
fovYfromX(xfov, aspectRatio) Field of view angle Y from X
invertArray() Negate all elements of an array
isConsiderZero(f) Is less than EPSILON
isPerfectSquare(n) Is perfect square
isPowerOfTwo(x) Is power of 2
max2(x, y) Find maximum of two values
max3(x, y, z) Find maximum of three values
min2(x, y) Find minimum of two values
min3(x, y, z) Find minimum of three values
networkByteOrder(value) Byte operations
nextPowerOfTen(k) Round to next power of 10
nextPowerOfTwo(k) Round to next power of 2
oneOfIsZero() If at least one element is zero
radtodeg(angle) Convert radians to degrees
sign(x) Sign of a number
sum() Sum of all elements of an array
swap(a, b) Swap values

Enums

NameDescription
Axis Axes of Cartesian space

Manifest constants

NameTypeDescription
EPSILON Very small value