How about some vector noodles? - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7) +---- Thread: How about some vector noodles? (/showthread.php?tid=2682) |
RE: How about some vector noodles? - Sprezzo - 05-14-2024 ----- RE: How about some vector noodles? - bplus - 05-14-2024 gots to remember target audience for tutorial is not for physics phd wanna-be's. RE: How about some vector noodles? - Sprezzo - 05-14-2024 ----- RE: How about some vector noodles? - TerryRitchie - 05-14-2024 (05-14-2024, 04:26 PM)bplus Wrote: imho 'vector' is an over complication of the location of a simple point on a plane, not really basic is it?LOL, yeah, typos. Good catch, I didn't even notice that. The older I get the more my brain fills in the missing stuff for me. It's kinda like AI I suppose ... hallucinations. RE: How about some vector noodles? - Dav - 09-17-2024 Just now came across this little gem. Nice snippet, Terry! Did you make any updates to this one? - Dav RE: How about some vector noodles? - PhilOfPerth - 09-17-2024 All waaay above my head, but playing with this, I could see an interesting game possibly along the lines of "Clear the cobwebS", or something more catchy. Fun effect! RE: How about some vector noodles? - bplus - 09-17-2024 Here is what a vector is: Quote:What is the definition of a vector? Quote:TYPE PARTICLE ' PARTICLE PROPERTIES using 2 magnitutes xv, yv is not a vector but 2 components from which you can derive the vector magnitude and direction. Imagine a vector as an arrow on the screen or graph, the length of arrow represents the magnitude and the direction from base to arrow head is the angle or heading. So there are 2 points base location and head location (x1, y1) and (x2, y2) dx = (x2 - x1) : dy = (y2 - y1) are the vector COMPONENTS the magnitude of arrow or vector = SQR(dx^2 + dy^2) just the distance or length of the arrow, good old Pythagorean Theorem here. the angle or heading of arrow or vector = _Atan2(dy, dx) (so sorry for the Advanced Trig but easiest way to get there in Basic). Yes point locations can be considered vectors from the origin of a graph (x, y) can be polarized (ha my term meaning converted to Polar coodinates x = dx, y = dy and using the above formula for magnitude and angle. (10, 10) converts to SQR(200) magnitude and 45 degrees heading which on the Basic Screen is down and to the right from (0,0) the top left of screen. Remember on Basic Screens 0 degrees is due East and the y axis INCREASE going down the screen which is NOT how you learn it in math and physics. In summary a vector is an arrow different from a line segment because it has a direction it is going. Terry is dividing by d the magnitude and skipping the angle calcs so xv and yv can be considered velocities eg, how fast and pos or negative direction on x and y axis on each loop. An arrow going straight up will not change in x axis but will decrease on y axis only, xv = 0 yv = -whatever RE: How about some vector noodles? - TerryRitchie - 09-17-2024 (09-17-2024, 11:06 AM)Dav Wrote: Just now came across this little gem. Nice snippet, Terry!No, no updates. One of the many things I've played with and moved on. RE: How about some vector noodles? - bplus - 09-18-2024 I did this yesterday, thought better of it and didn't post. Now I think worse of it Code: (Select All) _Title "bplus overhaul Vector noodling of Terry Ritchie" ' b+ 2nd x 2024-09-18 Let us be saved from vectors! RE: How about some vector noodles? - Dav - 09-18-2024 That's neat too, bplus. I was playing around with your mod some. You know I've been messing with bouncing and velocity lately, so couldn't resist using it. Here's a swarm. Mouse still controls. Really surprised so many particles can be handled smoothly. - Dav Code: (Select All)
|