Difference between revisions of "findProjectileTrajectory"
(Yay! Projectile finding thingy.) |
m (Added missing property for the category page, removed superfluous section.) |
||
Line 11: | Line 11: | ||
end | end | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
[[Category:Snippets]] | [[Category:Snippets]] | ||
{{#set:Author=User:Substitute541}} | {{#set:Author=User:Substitute541}} | ||
+ | {{#set:LOVE Version=any}} | ||
{{#set:Description=Finds a projectile's position at a certain time}} | {{#set:Description=Finds a projectile's position at a certain time}} | ||
== Other Languages == | == Other Languages == | ||
{{i18n|findProjectileTrajectory}} | {{i18n|findProjectileTrajectory}} |
Latest revision as of 00:33, 12 November 2016
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
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