2.5: The map() Function - p5.js Tutorial

preview_player
Показать описание


Timestamps:
0:00 Hello! Let's talk about the map function.
0:32 Let's start with an example.
3:03 Trying to change the range of mouseX without map().
4:17 That sort of worked, but what about other scenarios?
5:12 Let's see if I can explain how to use map().
7:44 How about we try it out!
8:27 Let's have some fun with map()!
9:39 How could you take this farther?

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

#math #basics #p5js #javascript
Рекомендации по теме
Комментарии
Автор

Gotta say its the best teacher you will ever get, even old vids of him is masterpiece.

Itspurenoob
Автор

5:04 It is truly a privilege and a pleasure to see someone wiping the board on YouTube these days and not get cut off on the edit. Thanks Dan!

pozzomarc
Автор

I learned far more from you than what I learnt at my university

octolearn
Автор

Only 2 years late, but I really appreciate all these tutorials!
Cheers (:

smalpiper
Автор

The amount of joy i get from varying the code i see here even minutely and getting it to work in unparalleled. Thanks so much dan!

pointstudio
Автор

I love your conversational style of teaching, and how you give challenges after each tutorial which are perfectly bite sized. Thank you so much for explaining Javascript and coding logics so beautifully. I used to be scared to code, this is so motivating and I feel I actually learned something new on a regular basis. Very grateful to you Todd :)

harshikerfuffle
Автор

In class they tell us to aspire to explain code like our favourite programmer on YouTube. I seriously aspire to code, think, and explain like you.

nattullos
Автор

Map function is pretty cool, Last time when I searched for it in web, it took around one hour to properly understand it from various references. You compiled it well.

deepankverma
Автор

Dude, your channel is taking off like a rocket since the last time i checked.

liinkx
Автор

The Coding Train is now one of my favourite channels. it is way better the buying an online course. Thank You!

josharpe
Автор

Bruh thank you so much!! Was trying to get this yesterday all night lol. Subscribed!!

Junior-rddz
Автор

Before this video, I would have ( mouseX/600)*255. But it is cool to know about this :)

omarhedaya
Автор

Oh my Goodness, I finally don't have to worry about resizing graphics in my sketch window in weird ways using complex math again!!! I can just map them now from a constant/defined/already decided canvas size now :D

This is so helpful :P

Brahvim
Автор

Dan is iconic. The man cares and it SHOWS

genevaleerobles
Автор

Thank you for making coding so easy to understand!!! This is a GREAT explanation on mapping.

tokidokiknitter
Автор

Encouraging teaching sir. NOT a lot of dead stuffs (cliche)! Thanks DAN!

badruzzaman
Автор

been following along though the playlist i feel like im in school with one of the cool teachers that you actually want to learn from and want to show up to class for.

bunzguy
Автор

The math of the map function is :

function map(value, minA, maxA, minB, maxB) {
return (1 - ((value - minA) / (maxA - minA))) * minB + ((value - minA) / (maxA - minA)) * maxB;
}

If i dont have made mistake, the math is correct :)

numeromojeangering
Автор

I was searching a lot about map( ) and didn't find as I expected, luckily I found your video :)

skrezwan
Автор

map() is a wonderful function! I like your explanation and example of it.

endofmysteries