Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How about some vector noodles?
#17
Here is what a vector is:
Quote:What is the definition of a vector?
: a quantity that has magnitude and direction and that is commonly represented by a directed line segment whose length represents the magnitude and whose orientation in space represents the direction. broadly : an element of a vector space. b. : a course or compass direction especially of an airplane.

Quote: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

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 Smile 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
b = b + ...
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 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: 15 Guest(s)