Functions
ai_math.h File Reference

Math operations. More...

#include "ai_api.h"
#include "ai_constants.h"
#include <cmath>
#include <cstdlib>
#include <cstring>

Go to the source code of this file.

Functions

template<typename T >
AI_DEVICE constexpr T AiMin (T a, T b)
 Minimum of 'a' and 'b'.
 
template<typename T >
AI_DEVICE constexpr T AiMax (T a, T b)
 Maximum of 'a' and 'b'.
 
template<typename T >
AI_DEVICE constexpr T AiMin (T a, T b, T c)
 Minimum of three values: a, b, c.
 
template<typename T >
AI_DEVICE constexpr T AiMax (T a, T b, T c)
 Maximum of three values: a, b, c.
 
template<typename T >
AI_DEVICE constexpr T AiMin (T a, T b, T c, T d)
 Minimum of four values: a, b, c, d.
 
template<typename T >
AI_DEVICE constexpr T AiMax (T a, T b, T c, T d)
 Maximum of four values: a, b, c, d.
 
template<typename T >
AI_DEVICE constexpr T AiSqr (T a)
 Square of 'a'.
 
template<typename T >
AI_DEVICE constexpr T AiClamp (T v, T lo, T hi)
 Clamp the input to the specified range.
 
template<typename T >
AI_DEVICE constexpr T AiSafeAcos (T x)
 Safe arc cosine of 'x' (acos() returns NaN if x<-1 or x>1)
 
template<typename T1 , typename T2 >
AI_DEVICE constexpr T1 AiLerp (T2 t, T1 a, T1 b)
 Linear interpolation between 'a' and 'b' using 't' (0<=t<=1)
 
template<typename T >
AI_DEVICE constexpr T AiHerp01 (T t)
 Hermite interpolation between 0 and 1 using 't' (0<=t<=1)
 
template<typename T1 , typename T2 >
AI_DEVICE constexpr T1 AiHerp (T2 t, T1 a, T1 b)
 Hermite interpolation between 'a' and 'b' using 't' (0<=t<=1)
 
template<typename T1 , typename T2 >
AI_DEVICE T1 AiBiLerp (T2 s, T2 t, T1 c00, T1 c10, T1 c01, T1 c11)
 Bilinear interpolation between four float values using 's' and 't' (0<=st<=1)
 
template<typename T >
AI_DEVICE constexpr T AiBias (T a, T b)
 Bias function.
 
template<typename T >
AI_DEVICE constexpr T AiGain (T a, T g)
 Gain function.
 
template<typename T >
AI_DEVICE constexpr T AiStep (T x, T e)
 Step function.
 
template<typename T >
AI_DEVICE constexpr T AiFilterStep (T x, T e, T w)
 Filtered-step function.
 
template<typename T >
AI_DEVICE constexpr T AiLinearStep (T lo, T hi, T t)
 Linearly interpolated step from 'lo' to 'hi'. More...
 
template<typename T >
AI_DEVICE constexpr T AiSmoothStep (T e0, T e1, T t)
 RenderMan's smoothstep() function. More...
 
template<typename OUT_T , typename IN_T >
AI_DEVICE OUT_T reinterpret_type (const IN_T in)
 This function can be used to go between different interpretations of the same bits. More...
 
AI_API AI_DEVICE AI_CONST bool AiIsFinite (float x)
 Test to see if the given floating point number is finite (not NaN and not infinite) as defined by the IEEE-754 standard. More...
 
AI_API AI_CONST float AiFastExp (float x)
 Fast, approximate expf() suitable for cases where performance is more critical than accuracy. More...
 
AI_API AI_DEVICE AI_CONST float AiFastPow (float x, float y)
 Fast, approximate powf() suitable for cases where performance is more critical than accuracy. More...
 

Detailed Description

Math operations.


© 2022 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com