View Single Post
Default   #126   Coda Coda is offline
Developer
The square brackets are just an element-wise description of a vector. [1, 1] represents a two-dimensional vector with magnitude sqrt(2) pointing in a direction 45 degrees above the x axis -- that is, [1, 1] describes a vector starting at (0, 0) and going to (1, 1). (It also describes a vector starting at (1, 2) and going to (2, 3) -- the magnitude and direction of a vector is independent of its position in space.)

Labeling your variables descriptively is always good. :P I'd probably use m_c and m_b instead of spelling out "cannon" and "ball", but you should only use subscripted numbers when you're actually referring to numeric values, such as a position in a list or a point in time (which is why x_0 for "initial position" is good).

Your EDIT2 is exactly correct.
Games by Coda (updated 4/8/2025 - New game: Marianas Miner)
Art by Coda (updated 8/25/2022 - beatBitten and All-Nighter Simulator)

Mega Man: The Light of Will (Mega Man / Green Lantern crossover: In the lead-up to the events of Mega Man 2, Dr. Wily has discovered emotional light technology. How will his creations change how humankind thinks about artificial intelligence? Sadly abandoned. Sufficient Velocity x-post)
Old Posted 01-24-2017, 11:51 PM Reply With Quote