Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Bias a value in the unit interval either lower or higher
ResourceFunction["BiasedRescale"][a,x] biases x toward lower values if a<1/2 and toward higher values if a>1/2 as x runs from 0 to 1. | |
ResourceFunction["BiasedRescale"][a,x,{min,max}] biases x as x runs from min to max. | |
ResourceFunction["BiasedRescale"][a,x,{min,max},{ymin,ymax}] biases x as x runs from min to max, with the result rescaled to run from ymin to ymax. |
Evaluate numerically:
In[1]:= |
|
Out[1]= |
|
Plot over a subset of the reals:
In[2]:= |
|
Out[2]= |
|
Plot different bias functions:
In[3]:= |
|
Out[3]= |
|
Evaluate for symbolic x:
In[4]:= |
|
Out[4]= |
|
BiasedRescale threads over lists in its first and second arguments:
In[5]:= |
|
Out[5]= |
|
In[6]:= |
|
Out[6]= |
|
Plot different bias functions with a rescaled domain:
In[7]:= |
|
Out[7]= |
|
Plot different bias functions with a rescaled domain and range:
In[8]:= |
|
Out[8]= |
|
Compare the Schlick and Perlin bias functions:
In[9]:= |
|
Out[9]= |
|
In[10]:= |
|
Out[10]= |
|
Adjust the middle color of a built-in color gradient:
In[11]:= |
|
Out[11]= |
|
Demonstrate the effect of BiasedRescale on easing in/easing out:
In[12]:= |
|
Out[12]= |
|
BiasedRescale[1/2,x,{min,max}] is equivalent to Rescale[x,{min,max}]:
In[13]:= |
|
Out[13]= |
|
BiasedRescale is left unevaluated if the first argument is non-numeric:
In[14]:= |
|
Out[14]= |
|
BiasedRescale is left unevaluated if the first argument is not a real number between 0 and 1:
In[15]:= |
|
Out[15]= |
|
Use BiasedRescale with the resource function GaussianQuadratureWeights to evaluate a Cauchy principal value integral.
The function to be integrated and the integration limits:
In[16]:= |
|
Even-order Gaussian quadrature abscissas and weights:
In[17]:= |
|
The transformation function to be applied to the abscissas and weights:
In[18]:= |
|
Transform the abscissas and weights:
In[19]:= |
|
Out[19]= |
|
In[20]:= |
|
Out[20]= |
|
Compute the integral:
In[21]:= |
|
Out[21]= |
|
Compare with the result of NIntegrate:
In[22]:= |
|
Out[22]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License