## quartic (`lygia`/`math`/`quartic`)

quartic polynomial https://iquilezles.org/articles/smoothsteps/

Use:

``````<float|vec2|vec3|vec4> quartic(<float|vec2|vec3|vec4> value);
``````

Check it on Github

``````
#ifndef FNC_QUARTIC
#define FNC_QUARTIC

float quartic(const in float v) { return v*v*(2.0-v*v); }
vec2  quartic(const in vec2 v)  { return v*v*(2.0-v*v); }
vec3  quartic(const in vec3 v)  { return v*v*(2.0-v*v); }
vec4  quartic(const in vec4 v)  { return v*v*(2.0-v*v); }

#endif
``````

Use:

``````<float|float2|float3|float4> quartic(<float|float2|float3|float4> value);
``````

Check it on Github

``````
#ifndef FNC_QUARTIC
#define FNC_QUARTIC

float   quartic(const in float v)   { return v*v*(2.0-v*v); }
float2  quartic(const in float2 v)  { return v*v*(2.0-v*v); }
float3  quartic(const in float3 v)  { return v*v*(2.0-v*v); }
float4  quartic(const in float4 v)  { return v*v*(2.0-v*v); }

#endif
``````

Check it on Github

``````
fn quartic(v: f32) -> f32 { return v*v*(2.0-v*v); }
fn quartic2(v: vec2f) -> vec2f { return v*v*(2.0-v*v); }
fn quartic3(v: vec3f) -> vec3f { return v*v*(2.0-v*v); }
fn quartic4(v: vec4f) -> vec4f { return v*v*(2.0-v*v); }
``````

Dependencies:

Use:

``````<float|float2|float3|float4> quartic(<float|float2|float3|float4> value);
``````

Check it on Github

``````

#ifndef FNC_QUARTIC
#define FNC_QUARTIC

inline __host__ __device__ float   quartic(float v)   { return v*v*(2.0f-v*v); }
inline __host__ __device__ float2  quartic(const float2& v)  { return v*v*(2.0f-v*v); }
inline __host__ __device__ float3  quartic(const float3& v)  { return v*v*(2.0f-v*v); }
inline __host__ __device__ float4  quartic(const float4& v)  { return v*v*(2.0f-v*v); }

#endif
``````