1.4: Vector Math II - The Nature of Code

preview_player
Показать описание
This video continues the discussion about vector mathematics. How to calculate a vector's magnitude (using PVector mag()) and how to normalize a vector (using normalize()) are also discussed.

Help us caption & translate this video!

Рекомендации по теме
Комментарии
Автор

"Something we want in our lives is to just be normal sometimes. Actually we don't want to be normal. I actually have no idea what I'm talking about. Who knows what we want in our lives? Vectors. Sometimes we want our vectors to be normal. Forget about out lives, I know nothing about how to deal with what's life, but I do know something about vectors!"

ahmaykmewsik
Автор

You are a really gifted teacher Daniel! I'm new to coding and Im learning to use C#, but the concepts you teach in this videos are solid gold! Thanks you very much! Greetings from Buenos Aires, Argentina!

ggilabert
Автор

This is extremely useful thank you as a physcist this gives me a great way to simulate what i do with my math or experiments I cant do in real life.

eduardatonga
Автор

There is the Math.hypot(x, y) function which does exactly the same thing as Math.sqrt(x*x + y*y). It's especially designed for calculating distance which means its much faster and it's much more compact than its counterpart.

Invalid
Автор

this video did help because you showed the math of the PVector and I made the same thing in javascript

valforeststorm
Автор

watching all these videos at 1.25x or 1.5x speed = endless entertainment

michaelalbert
Автор

Your videos are amazing and easy to understand. Thank you Daniel!

ahmadsebaq
Автор

Your videos are absolutely insightful! I thought mathematica was cool, but processing is the real deal !

oscarmejia
Автор

Depending on which ad you watched, it's like Shiffman is reacting to it in the first 2 seconds of the video! XD

katsumoto
Автор

You are awesome, it sounds strange but you saved my life😁😁

efed
Автор

You're the best! Thank you Daniel!

MrFruture
Автор

when i deal with vector i have realised that when i dont use translate() function the vector subtract gives a very different result could you please tell me how i can get the same result in vector subtract without using translate (); ?

junezaniyazi
Автор

Caralho!! Finamente entendi o que é normalizar um vector!

augustogava
Автор

what is the limitation of building a program with p2 or p3? i dont want to learn all this to find myself not being able to actually do what i want cuz of the lag or memory problems

ClearNinjaFox
Автор

thank you so much Dan, your videos are more than awesome, i have a question i did the exact code but the arrow not moved according to my mouse location

haneenn.k
Автор

Please correct me if I am wrong, but you used translate and you made the center point the point 0, 0 . Shouldn't you write PVector center = new PVector(0, 0); ???? why did you put (width/2, height/2); You have already done the translation :/

ArisMelachroinos
Автор

So your wallpaper has normalized vectors?

coreyp
Автор

I don't get why are you subtracting and translating vectors to draw a line. Is that for demonstration ? This works as well and is less confusing I think:

PVector start = new PVector();

void setup(){
size(640, 480);
background(255);
start.x = width/2;
start.y = height/2;
}

void draw(){

background(255);
strokeWeight(2);
stroke(0);
noFill();

//translate(width/2, height/2);
ellipse(start.x, start.y, 4, 4); //center

PVector mouse = new PVector(mouseX, mouseY);
//PVector center = new PVector(width/2, height/2);
//mouse.sub(start);

line(start.x, start.y, mouse.x, mouse.y);

fill(0, 255, 0, 50);
mouse.sub(start);
rect(start.x, start.y, mouse.x, mouse.y);
}

void mouseClicked() {
start.x = mouseX;
start.y = mouseY;
}

QwertyNPC
Автор

while( this.x > 1 || this.y > 1 ){
this.x *= 0.999; this.y *= 0.999;
}

Pompiduskus
Автор

okay, so i got totally distracted when i started coding! and now i have build this ..

Shockszzbyyous