We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I am trying to figure out how this map() function works... but I just don't get it. Maybe you guys can help me out..
For example:
float a;
void setup(){
size(300, 300);
}
void draw(){
a= 50;
a=map(a, -100, 100, 0, 2000);
}
How big wil "A" be after the mapping and why?
Answers
just
println(a);
to find out...the input values go from -100 to 100. 50 is 3/4s of the way along that line so the output is 3/4s of the way along the line from 0 to 2000 (= 1500)
Thx allot!
so if A would be 0. The output would be 1000?
try it!
(yes)
You sir, are my hero.. I will try it.
Thank you!