Function Repository Resource:

# RationalSmoothStep

A sigmoidal interpolating rational function

Contributed by: Jan Mangaldan
 ResourceFunction["RationalSmoothStep"][x] gives a rational sigmoidal function between [0,1] for a position x in [0,1]. ResourceFunction["RationalSmoothStep"][n,x] is the rational smoothstep function of order n at position x.

## Details

The rational smoothstep function is defined as Rn(x)=xn/(xn+(1-x)n).
The rational smoothstep function can be used as a replacement for the usual polynomial-based smoothstep in computer graphics.
For x values less than 0 or greater than 1, the result clamps to 0 and 1, respectively.
ResourceFunction["RationalSmoothStep"][x] is equivalent to ResourceFunction["RationalSmoothStep"][3,x].
ResourceFunction["RationalSmoothStep"] can be evaluated to arbitrary numerical precision.

## Examples

### Basic Examples (2)

Interpolate at a position on a step:

 In[1]:=
 Out[1]=

Show rational smooth steps for multiple orders:

 In[2]:=
 Out[2]=

### Scope (3)

Evaluate at an exact position:

 In[3]:=
 Out[3]=

At a numeric position:

 In[4]:=
 Out[4]=

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

### Applications (1)

Use RationalSmoothStep to implement a "smooth" version of Hue (reference):

 In[7]:=
 In[8]:=
 Out[8]=
 In[9]:=
 Out[9]=

### Properties and Relations (1)

RationalSmoothStep satisfies a symmetry relation:

 In[10]:=
 Out[10]=

### Neat Examples (1)

Use RationalSmoothStep to demonstrate "ease-in/ease-out":

 In[11]:=
 Out[11]=

## Version History

• 1.0.1 – 15 March 2021
• 1.0.0 – 10 March 2021