Skip to content

Commit 563aa40

Browse files
committed
Updated the text on the Map.pde
Fixed some formatting errors with the Map() example
1 parent 5896443 commit 563aa40

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • content/examples/Basics/Math/Map
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* map()
2+
* Map()
33
*
44
* Using the map() function allows you to take any number,
55
* and scale it to a number that is more useful to the project
@@ -11,17 +11,17 @@
1111
*
1212
*/
1313
void setup() {
14-
size(700, 500);
14+
size(640, 360);
1515
noStroke();
1616
}
1717

1818
void draw() {
1919
background(0);
20-
// mouseX has a min of 0 and a max of 700 (the width of the window)
21-
// here we are scaling that variable from 0 to 700 to a number between 0 and 255
20+
// mouseX has a min of 0 and a max of 640 (the width of the window)
21+
// here we are scaling that variable from 0 to 640 to a number between 0 and 255
2222
float c = map(mouseX, 0, width, 0, 175);
2323
// here we are scaling that same variable to a range between 40 and 440
24-
float d = map(mouseX, 0, width, 40, 440);
24+
float d = map(mouseX, 0, width, 40, 300);
2525
fill(255, c, 0);
2626
ellipse(width/2, height/2, d, d);
2727
}

0 commit comments

Comments
 (0)