Euphoria
S-Curve

A tweakable curve similar to easing functions. More...

Classes

struct  eu::core::SCurve
 Contains the parameters for an S-Curve. More...

Functions

SCurve eu::core::s_curve_from_input (float x, float y)
 Generate an S-Curve from user input.
float eu::core::calculate_s_curve (float x, float slope, float threshold)
 Calculates an S-Curve.

Detailed Description

A tweakable curve similar to easing functions.

Discovered by Yann van der Cruyssen/Morusque on twitter. From A Convenient Generalization of Schlick’s Bias and Gain Functions (pdf) by Jonathan T. Barron.

Function Documentation

◆ calculate_s_curve()

float eu::core::calculate_s_curve ( float x,
float slope,
float threshold )

#include <scurve.h>

Calculates an S-Curve.

this takes floats instead of the curve since that means it could more easily be copied to glsl

Parameters
x[0,1]
slope>=0
threshold[0,1]

◆ s_curve_from_input()

SCurve eu::core::s_curve_from_input ( float x,
float y )

#include <scurve.h>

Generate an S-Curve from user input.

Adapted from Colugo's S curve editor implemented in/on desmos

Parameters
x[0,1] 0=left, 1=right
y[0,1] 0=bottom, 1=top