map()
Math / CalculationDescription
Re-maps a number from one range to another.
Syntax
float map(float value, float start1, float stop1, float start2, float stop2)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | the incoming value to be converted |
| start1 | float | lower bound of the input range |
| stop1 | float | upper bound of the input range |
| start2 | float | lower bound of the output range |
| stop2 | float | upper bound of the output range |
Returns
floatRelated
Under the Hood
From Processing.h:
float map(float,float,float,float,float);
return _api::map((float)value,(float)start1,(float)stop1,(float)start2,(float)stop2);
static float map(float v,float i0,float i1,float o0,float o1) { return o0+(v-i0)*(o1-o0)/(i1-i0); }
inline float map(float v,float i0,float i1,float o0,float o1){ return PApplet::map(v,i0,i1,o0,o1); }
inline float map(float v,float i0,float i1,float o0,float o1){ return PApplet::map(v,i0,i1,o0,o1);