findProjectileTrajectory
Finds a projectile's position at a certain time.
Variable Definitions : ri = initial position {x, y} ; vi = intial velocity {vx, vy} ; g = gravity {gx, gy} ; t = time
-- This assumes that ri, vi, and g are put in the {x, y} notation
function findProjectileTrajectory(ri, vi, g, t)
local rfx = ri[1] + vi[1]*t + (g[1] * t^2)/2
local rfy = ri[2] + vi[2]*t + (g[2] * t^2)/2
return rfx, rfy
end
Contributors
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info