Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How about some vector noodles?
#5
(05-13-2024, 05:42 PM)Sprezzo Wrote: Hey Terry,

Looks great, however I need to fix something I noticed years ago in your terminology.

You're mixing "vector" with "velocity". Reduced example being:

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
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.

So that's point #1, point #2 has to to with units. For instance:

Code: (Select All)
        Particle(p).x = Particle(p).x + Particle(p).xv
        Particle(p).y = Particle(p).y + Particle(p).yv
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 * 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.
@Sprezzo

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.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
How about some vector noodles? - by TerryRitchie - 05-13-2024, 03:30 PM
RE: How about some vector noodles? - by bplus - 05-13-2024, 04:43 PM
RE: How about some vector noodles? - by Sprezzo - 05-13-2024, 05:42 PM
RE: How about some vector noodles? - by TerryRitchie - 05-13-2024, 06:35 PM
RE: How about some vector noodles? - by GareBear - 05-13-2024, 08:17 PM
RE: How about some vector noodles? - by bplus - 05-13-2024, 11:33 PM
RE: How about some vector noodles? - by NakedApe - 05-14-2024, 01:15 AM
RE: How about some vector noodles? - by Sprezzo - 05-14-2024, 04:11 PM
RE: How about some vector noodles? - by bplus - 05-14-2024, 04:26 PM
RE: How about some vector noodles? - by Sprezzo - 05-14-2024, 04:28 PM
RE: How about some vector noodles? - by bplus - 05-14-2024, 04:40 PM
RE: How about some vector noodles? - by Sprezzo - 05-14-2024, 06:44 PM
RE: How about some vector noodles? - by Dav - 09-17-2024, 11:06 AM
RE: How about some vector noodles? - by bplus - 09-17-2024, 03:01 PM
RE: How about some vector noodles? - by bplus - 09-18-2024, 08:07 PM
RE: How about some vector noodles? - by Dav - 09-18-2024, 10:37 PM
RE: How about some vector noodles? - by bplus - 09-18-2024, 10:51 PM
RE: How about some vector noodles? - by sbblank - 09-18-2024, 11:13 PM



Users browsing this thread: 3 Guest(s)