Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Projectile/Projectile.cpp
- Revision:
- 11:4e2eb64031a0
- Parent:
- 9:fe912235dd71
- Child:
- 12:9e6d5d0a0c82
--- a/Projectile/Projectile.cpp Fri Apr 12 12:01:47 2019 +0000
+++ b/Projectile/Projectile.cpp Sat Apr 13 16:31:43 2019 +0000
@@ -40,7 +40,7 @@
{
_position_x = _init_x + _init_vel * _time * cos(_lnch_ang * DEG2PI) - 0.5 * _wind_acc * _time * _time;
_position_y = _init_y + _init_vel * _time * sin(_lnch_ang * DEG2PI) - 0.5 * _grav_acc * _time * _time;
- _time++;
+ _time += 0.4;
}
bool Projectile::check_boundaries()
@@ -55,9 +55,9 @@
_position_y = y;
}
-void Projectile::set_launch_parameters(int t, int x, int y, float ang, float vel, float grav, float wind)
+void Projectile::set_launch_parameters(int x, int y, float ang, float vel, float grav, float wind)
{
- _time = t;
+ _time = 0;
_init_x = x;
_init_y = y;
_lnch_ang = ang;