there was a period in my life when I was extremely depressed and almost end it, then I discovered coding (it seemed very intimidating almost non achievable that I could learn to code, my personality and perhaps my nature was and is constantly provoking me to give it up), im into my second month of programming , about a week back I came across your channel .... every one of your video that I watch it increments my will to succeed, I sincerely thank you for the knowledge that you have so generously shared with the likes of myself
I am sorry to hear about your depression and thrilled to know that my channel might be helping you even if in a small way. You can succeed, you will succeed, I know it!
@@TheCodingTrain I first came across this programming tutorial on Kahn Academy but you explain the topic extremely intuitively (albeit you are extremely quirky as well!)
Your video it's amazing Daniel! You've brought back the passion for physics and spawned a passion for the coding. I'm really glad to have bought your books!
I've been trying to create a little gravity simulation in Java and was wondering why my orbits had the shape of a spirograph picture instead of being elliptical. Came here and found out I had to normalize the force before applying the gravitational formula...then it took me another half hour to realize WHY it was necessary -.- Thank you so much for your videos.
Precession of orbit is totally a thing, and would produce spirograph-like patterns EDIT: It's called "axial precession", where the axis of orbit precesses around the center
Great series so far, but I have to say, when you used constrict it made me feel really uneasy. You could have just increased the gravitational constant, or the masses of the objects. If for some reason that would have caused some strange behavior because of the objects moving too fast, constricting the maximum velocity of the movers would have been a better option, because that at least has an analog in the real world, while forces that stop getting weaker, don't.
Would've also meant that if the object got too far away it wouldn't come back at any reasonable rate, so probably for demonstration purposes. I was also thinking he should just change G, or maaaaaaybe just divide the distance by a constant to make it less influential.
I really hate mechanics if written on a paper, but just seeing results of such equations in a program is stunning. If we could only do these sorts of things in our science studies.
When I use attraction I didn't think about it this much ha. I just use - velocity.add( (pos2.x - pos1.x )/dist(pos2.x,pos2.y,pos1.x,pos2.y), (pos2.y - pos1.y )/dist(pos2.x,pos2.y,pos1.x,pos2.y))
Is there an email address I could find this speaker at? I have an interesting project and I have a couple of questions. We are writing an academic paper on how the Mayans tracked Venus with their base-260 Tzolk’in calendar.
Damilola Olagundoye Setting the magnitude using setMag() actually does the same thing. it normalizes the vector first and then it scales it using mult()
Check out Keith Peters' Coding Math Channel. He creates an entire physics simulation from the ground up, with explanations every step of the way. Coding Train is more general principles.
"My pancreas attracts every other Pancreas in the universe With a force proportional To the product of their masses And inversely proportional To the distance between them Woo woo woo woo!" -Weird Al Yankovic, "Pancreas"
I wrote this in Delphi: vel.X:= -sqrt(k *d); k:= force.Mag(); force:= ApplyUGF(sun, jupiter) function ApplyUFG(S: TBall; var P: TBall): TVector; const G = 6.67 *10E-11; var f, d: real; begin force.Assign(P.loc); force.Sub(S.loc); d:= force.Mag; force.Norm; // dim.Z contains the mass f:= (G *P.dim.Z *S.dim.Z) /(d *d); force.Mult(-f); result:= force; end;
This video covers repulsion! ua-cam.com/video/OAcXnzRNiCY/v-deo.html (But the short answer is just multiply the attraction force by -1 to reverse direction!)
there was a period in my life when I was extremely depressed and almost end it, then I discovered coding (it seemed very intimidating almost non achievable that I could learn to code, my personality and perhaps my nature was and is constantly provoking me to give it up), im into my second month of programming , about a week back I came across your channel .... every one of your video that I watch it increments my will to succeed, I sincerely thank you for the knowledge that you have so generously shared with the likes of myself
I am sorry to hear about your depression and thrilled to know that my channel might be helping you even if in a small way. You can succeed, you will succeed, I know it!
@@TheCodingTrain I first came across this programming tutorial on Kahn Academy but you explain the topic extremely intuitively (albeit you are extremely quirky as well!)
Deaf dog what platform is he coding on
@@lovetant9307 Processing
I think that your channel is already the channel that I've spent the most time in my life. I'm learning so much here. Thank you!
For all those who aren't getting an orbital feel of this simulation, he has also applied a constant velocity of (1, 0) to the movers.
I guess that I never had the opportunity to see how those kinds of stuff are magical.
Thank you very much for sharing.
Your video it's amazing Daniel!
You've brought back the passion for physics and spawned a passion for the coding.
I'm really glad to have bought your books!
wow i never knew if he had written any book before
Such a great series - your explanations give me the confidence to move forward into more advanced material.
I've been trying to create a little gravity simulation in Java and was wondering why my orbits had the shape of a spirograph picture instead of being elliptical. Came here and found out I had to normalize the force before applying the gravitational formula...then it took me another half hour to realize WHY it was necessary -.- Thank you so much for your videos.
Precession of orbit is totally a thing, and would produce spirograph-like patterns
EDIT: It's called "axial precession", where the axis of orbit precesses around the center
I watched the first two chapters and learned more then in one year in school. The for that
+Markus Burrer thank you!
Thankyou for all your hard work. Really enjoying
Thanks for the nice feedback!
Great series so far, but I have to say, when you used constrict it made me feel really uneasy. You could have just increased the gravitational constant, or the masses of the objects. If for some reason that would have caused some strange behavior because of the objects moving too fast, constricting the maximum velocity of the movers would have been a better option, because that at least has an analog in the real world, while forces that stop getting weaker, don't.
Would've also meant that if the object got too far away it wouldn't come back at any reasonable rate, so probably for demonstration purposes. I was also thinking he should just change G, or maaaaaaybe just divide the distance by a constant to make it less influential.
I really hate mechanics if written on a paper, but just seeing results of such equations in a program is stunning. If we could only do these sorts of things in our science studies.
Great videos, Daniel! You are clear, detailed and hilarious, so keep the vids coming!
Dan, these videos are great, they really have helped me a lot.
Excellent explanations 😊
I love your work, it is very inspiring
I love how you teach. I really like your videos, but I would like to see more on IOT apps. Thx
awesome tutorial! 🙂👌🏿
you are one of the good guys thx
1:17 -> Dan checking if he's recording. It's just a Dan thing. :P
For some reason i laughed so hard thank you
Although the lesson is very much explanatory, I feel I should learn this section form the book.
Dan,
I really enjoy the "physics" approach in these videos. Do you have a favorite Physics book, other than NOC?
Awesome
Daniel: *sees a constant*
also Daniel: ah yes 1
every time he sets a constant to 1 i can't stop laughing
great lessons tho helped me a lot :-)
Have you applied Gravity distribution model on python ?
When I use attraction I didn't think about it this much ha. I just use - velocity.add( (pos2.x - pos1.x )/dist(pos2.x,pos2.y,pos1.x,pos2.y), (pos2.y - pos1.y )/dist(pos2.x,pos2.y,pos1.x,pos2.y))
If attractors attract then do tractors track
Is there an email address I could find this speaker at? I have an interesting project and I have a couple of questions. We are writing an academic paper on how the Mayans tracked Venus with their base-260 Tzolk’in calendar.
what is the point of normalizing? doesnt it change the magnitude to 1? if so why not just set the mag to 1?
Damilola Olagundoye Setting the magnitude using setMag() actually does the same thing. it normalizes the vector first and then it scales it using mult()
Why are all the links to github not working here?
can you explain how to apply a gravitational vector in a 2D game envionment - im struggling with it :-(
Check out Keith Peters' Coding Math Channel. He creates an entire physics simulation from the ground up, with explanations every step of the way. Coding Train is more general principles.
How do you apply the force
It is the same concept bro
Where is that episode 2.8 ? Is it deleted or never recorded? I can't tell by 2019.
Universal Gravitational Constant = 6.67408 × 10^-11 m^3 kg^-1 s^-2
Af 😂😂
Thanks for physics engine.but can I do it in #c?
Yup
Genius!
"My pancreas attracts every other
Pancreas in the universe
With a force proportional
To the product of their masses
And inversely proportional
To the distance between them
Woo woo woo woo!"
-Weird Al Yankovic, "Pancreas"
I hope to use these lessons learned to create a BeyBlade simulator! :D
I wrote this in Delphi:
vel.X:= -sqrt(k *d);
k:= force.Mag();
force:= ApplyUGF(sun, jupiter)
function ApplyUFG(S: TBall; var P: TBall): TVector;
const
G = 6.67 *10E-11;
var
f, d: real;
begin
force.Assign(P.loc);
force.Sub(S.loc);
d:= force.Mag;
force.Norm;
// dim.Z contains the mass
f:= (G *P.dim.Z *S.dim.Z) /(d *d);
force.Mult(-f);
result:= force;
end;
I was just wondering how to make objects repulse in code instead of attracting.
Great video though!
This video covers repulsion! ua-cam.com/video/OAcXnzRNiCY/v-deo.html (But the short answer is just multiply the attraction force by -1 to reverse direction!)
6.67408 × 10^-11 m^3 kg^-1 s^-2
How do you deal multiple objects? I mean what attracts what?
The computation with just 100 objects is HUGE!
Look for my tutorial on QuadTrees and collisions!
calling Mover -> Particle would be better I think
Excelent, I didn't undestand a sheep from my class. :(
+Dana Cordova thanks for watching!
"And I also wouldn't be so lonely" Poor boyo..
A Normal Vector is always normalized, but a normalized vector is always a Normal Vector(?)
Who made that freaking dislike!!
!!!! W O w
i guess 1 person watched it upside down :/
your github does not exist.
Github not working, we can't find the code. Please, help.
Apologies, see: github.com/shiffman/The-Nature-of-Code-Examples/tree/master/chp02_forces