05-13-2024, 06:35 PM
(05-13-2024, 05:42 PM)Sprezzo Wrote: Hey Terry,@Sprezzo
Looks great, however I need to fix something I noticed years ago in your terminology.
You're mixing "vector" with "velocity". Reduced example being:
In the above, the information (x,y) is the position vector, and (xv, yv) is the velocity vector. Both are ordered pairs in the plane, both are vectors.Code: (Select All)TYPE PARTICLE ' PARTICLE PROPERTIES
x AS SINGLE ' y location
y AS SINGLE ' x location
xv AS SINGLE ' y vector
yv AS SINGLE ' x vector
END TYPE
So that's point #1, point #2 has to to with units. For instance:
Here, it looks like you're adding the velocity vector to the position vector. This is technically a mistake, because you're adding distance units to distance/time units. I can't add 7 miles to 3.5 miles per hour, there's a unit mismatch. To make that read more properly, you want:Code: (Select All)Particle(p).x = Particle(p).x + Particle(p).xv
Particle(p).y = Particle(p).y + Particle(p).yv
Code: (Select All)Particle(p).x = Particle(p).x + Particle(p).xv * TIMESTEP
Particle(p).y = Particle(p).y + Particle(p).yv * TIMESTEP
Then, let velocity be a reasonable number, and then let TIMESTEP be a very small increment in time. Right now you've got an implied timestep of 1 and tiny velocity per particle. No problem for this demo, but in general doing it that way can be... not really representative of motion at worst.
Aaaaanyway, take it all or leave it all. Your qb64 tutorial is already the best prose on QB64 ever written, I just wanna see it that much closer to perfect.
I'm completely self taught when it comes to math and I'm sure, as you pointed out, my terminology is suspect. I really do appreciate when people correct me on these matters. Since you are better versed on this could you do me a huge favor?
- Correct the above code to how it should look/perform.
- When you find time look over Lesson 17 and let me know what I need to change in there.
- Write me a quick tutorial on the proper use and terminology of vector math.
I'm constantly getting terminology mixed up and a tutorial on the subject I can refer back to would be a huge benefit and help me to correct Lesson 17 issues where they occur. My goal is to make the tutorial 100% accurate but I'm lacking in certain areas and help from others is greatly appreciated.