Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Parabola bullet thing
Author Message
RaLz

Posted: Mon May 26, 2003 3:56 pm   Post subject: Parabola bullet thing

ok im making that one tank game where there are two tanks on bothsides and you shoot a bullet and it has to make an arch shape to get to the other side and hit the other tank.
Now i know im supposed to use a parabola for the bullet but i am bad at math and i don't know where to start so if someone could please do the bullet process for me or help me out that would be great. It needs to include how much power the shot is going to have and altitude.

AsianSensation

Posted: Mon May 26, 2003 4:14 pm   Post subject: (No subject)

Projectile_Posx := Projectile_Velocity * cosd (Angle) * Projectile_Time
Projectile_Posy := (-1 / 2) * Gravity * Projectile_Time ** 2 + Projectile_Velocity * sind (Angle) * Projectile_Time

it's the coordinates for the projectile, put it in a loop, increase the time variable each loop, and u should have it. I also have the equation that involves air-resistance, if you want it, i'll post it up.
RaLz

Posted: Mon May 26, 2003 6:53 pm   Post subject: (No subject)

yea that would be cool if you could
RaLz

Posted: Mon May 26, 2003 6:56 pm   Post subject: (No subject)

also it would be cool if you could explain that code to me cuz i don't get any of it
void

Posted: Mon May 26, 2003 8:43 pm   Post subject: (No subject)

basic projectile physics:
x= v*cos*theta*t
y=v*sin*theta-g*t^2/2

v=velocity
cos and sin are constants (use sind and cosd when ur doing it in turing)
t= time
g= gravity (i think its 9.8 or 9.3 m/ s^2)
theta= angle at which the projectile is shot
x= x-co ordinate
y= y- co ordinate
but yea....if you dont understand that...you should go ask your math teacher...they'll prolly help you better AND they will think ur a smart kid and boost your mark a good 3-4 % any more help..just ask
RaLz

Posted: Mon May 26, 2003 8:46 pm   Post subject: (No subject)

thanx douchie
void

Posted: Mon May 26, 2003 8:51 pm   Post subject: (No subject)

yo!!.. who da blu...wiyado...who is this kid!!! and how does he know who i am...(only people i know can mess up my name like that and get away with it!!) lol..yea..who is this?
Homer_simpson

Posted: Mon May 26, 2003 8:52 pm   Post subject: (No subject)

oh that's some cool formula 8)
good to know...=)

RaLz

Posted: Mon May 26, 2003 8:53 pm   Post subject: (No subject)

Ok i don't get what the projectile time has to do with it
RaLz

Posted: Mon May 26, 2003 8:55 pm   Post subject: (No subject)

its Raheel
void

Posted: Mon May 26, 2003 8:56 pm   Post subject: (No subject)

how long it takes to get from the initial launching point to reach the landing point....just make time a constant...its better that way/......WHO ARE YOU?!?!?!?!?....TELL ME...BEFORE I KILLL YOU (that was not a threat)
Homer_simpson

Posted: Mon May 26, 2003 9:02 pm   Post subject: (No subject)

ok... i tried using it in turing... one problem...
how do u multiply sine or cos in the formula?
void

Posted: Mon May 26, 2003 9:15 pm   Post subject: (No subject)

 code: var x, y, th : real const v := 9 const t := 1 const g := 9.8 th := 12 x := v * cosd (th) * t y := v * sind (th) * t - g * t ** 2 / 2

now the only problem is making x and y back into integers so i can locate with themm.....
AsianSensation

Posted: Mon May 26, 2003 9:23 pm   Post subject: (No subject)

x := cosd(angle) + (mass * velocity * cosd(angle) / air resistance) * (1 - e**(-air resistance * time / mass))

y := sind(angle) - (mass * gravity * time / air resistance)+((mass * velocity * sind(angle) / air resistance) + (mass**2 * gravity / (air resistance**2))) * (1 - e**(-air resistance * time / mass))

http://www.phy.davidson.edu/StuHome/jocampbell/projectile/projectile.htm

I think that web site give u the equation and maybe some explaination for it.
RaLz

Posted: Mon May 26, 2003 9:35 pm   Post subject: (No subject)

Yeahhhh this game has gotten wayy to complicated for me since iam onlin gr 10 and ihaven't learnt that much physics i will prolly not be able to do this. So any other suggestions cuz i thought this game wouldn't be this hard
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 2  [ 27 Posts ]
Goto page 1, 2  Next
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: