HighMap library (C++)
Loading...
Searching...
No Matches
math.cpp File Reference

Namespaces

namespace  hmap
 

Functions

Array hmap::abs (const Array &array)
 Return the absolute value of the array elements.
 
Array hmap::abs_smooth (const Array &array, float mu)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Array hmap::abs_smooth (const Array &array, float mu, float vshift)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Array hmap::abs_smooth (const Array &array, float mu, const Array &vshift)
 Return the smooth absolute value of the array elements.
 
float hmap::abs_smooth (float a, float mu)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Array hmap::almost_unit_identity (const Array &array)
 Return the almost unit identity function.
 
float hmap::almost_unit_identity (float x)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
float hmap::almost_unit_identity_c2 (float x)
 Return the almost unit identity function (with a second-order derivative equals 0 at x = 1 also to avoid discontinuities in some cases)
 
Array hmap::atan (const Array &array)
 Return the arctan of the array elements.
 
Array hmap::atan2 (const Array &y, const Array &x)
 Computes the element-wise arctangent of two arrays, considering the signs of both inputs.
 
Array hmap::cos (const Array &array)
 Return the cosine of the array elements.
 
Array hmap::exp (const Array &array)
 Return the exponantial of the array elements.
 
float hmap::gain (float x, float factor)
 
Array hmap::gaussian_decay (const Array &array, float sigma)
 Return the Gaussian of the array elements.
 
Array hmap::hypot (const Array &array1, const Array &array2)
 
Array hmap::lerp (const Array &array1, const Array &array2, const Array &t)
 Return the linear interpolation between two arrays by a parameter t.
 
Array hmap::lerp (const Array &array1, const Array &array2, float t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
float hmap::lerp (float a, float b, float t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Array hmap::log10 (const Array &array)
 Return the log10 of the array elements.
 
Array hmap::pow (const Array &array, float exp)
 Return the array elements raised to the power 'exp'.
 
void hmap::radial_displacement_to_xy (const Array &dr, Array &dx, Array &dy, float smoothing=1.f, Vec2< float > center={0.5f, 0.5f}, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f})
 Interpret the input array dr as a radial displacement and convert it to a pair of displacements dx and dy in cartesian coordinates.
 
Array hmap::sin (const Array &array)
 Return the sine of the array elements.
 
Array hmap::smoothstep3 (const Array &array, float vmin=0.f, float vmax=1.f)
 Return the 3rd order smoothstep function of the array elements.
 
float hmap::smoothstep3 (float x)
 Return the 3rd order smoothstep function.
 
float hmap::smoothstep3_lower (float x)
 Return the 3rd order smoothstep function, with zero derivative only at 0.
 
Array hmap::smoothstep3_lower (const Array &x)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
float hmap::smoothstep3_upper (float x)
 Return the 3rd order smoothstep function, with zero derivative only at 1.
 
Array hmap::smoothstep3_upper (const Array &x)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Array hmap::smoothstep5 (const Array &array, float vmin=0.f, float vmax=1.f)
 Return the 5rd order smoothstep function of the array elements.
 
Array hmap::smoothstep5 (const Array &array, const Array &vmin, const Array &vmax)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
float hmap::smoothstep5 (float x)
 Return the 5rd order smoothstep function.
 
float hmap::smoothstep5_lower (float x)
 Return the 5rd order smoothstep function, with zero derivative only at 0.
 
Array hmap::smoothstep5_lower (const Array &x)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
float hmap::smoothstep5_upper (float x)
 Return the 5rd order smoothstep function, with zero derivative only at 1.
 
Array hmap::smoothstep5_upper (const Array &x)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
float hmap::smoothstep7 (float x)
 Return the 7th order smoothstep function.
 
Array hmap::smoothstep7 (const Array &x)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Array hmap::sqrt (const Array &array)
 Return the square root of the array elements.
 
Array hmap::sqrt_safe (const Array &array)