delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/21/21:30:35

Message-ID: <3888F4D3.5EDC8FBC@geocities.com>
From: Sahab Yazdani <beyonder69 AT geocities DOT com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Projectile Bouncing off walls
Lines: 31
Date: Fri, 21 Jan 2000 19:07:47 -0500
NNTP-Posting-Host: 209.5.18.127
X-Complaints-To: abuse AT sprint DOT ca
X-Trace: newscontent-01.sprint.ca 948499974 209.5.18.127 (Fri, 21 Jan 2000 19:12:54 EST)
NNTP-Posting-Date: Fri, 21 Jan 2000 19:12:54 EST
Organization: Sprint Canada Inc.
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello I have written a simple trajectory calcutation system using
Velocity, Angle, wind and gravity. Now lets say I want to make the
projectile bounce off the wall.. How would I go about doing this???
heres the code that I have right now:

   cV = velocity / 10;
   cA = angle;

   cA = ((180 + cA) / 180) * 3.1415926;

   initialXVel = cos(cA) * cV;
   initialYVel = sin(cA) * cV;

   cW = wind / 100;
   cG = 9.8 * gravity; // X times greater than Earth Gravity

   x = origin.x + (initialXVel*t)+(0.5 * (cW/5) * tsq);
   y = origin.y + (initialYVel*t)+(0.5 * cG * tsq);

// Where t is time (incremented by 0.005) and tsq is t*t

//   The last two lines repeat until the projectile hits the ground.

Thank you for any help you may provide
-- 
***********************************************************
* Sahab Yazdani * "We are all who we are, no more and no  *
* Thornhill S.S * less" - al'Lan Mandragoran              *
***********************************************************
* http://pheonixware.8m.com/                              *
***********************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019