Wednesday, March 23, 2011

Problem with the Y component of Vector

Heres a sample block of output from my program:


______________________________________________________________________
 Projectile Position: 0 0
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107


Object: Position- 8.99512,0.00488001 Velocity- 0.707107,-0.707107


Pings: 1:6 2:5
______________________________________________________________________
 Projectile Position: 1.99539 -0.135725
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107


Object: Position- 9.70223,-0.702227 Velocity- 0.707107,-0.707107


Pings: 1:7 2:6
______________________________________________________________________
 Projectile Position: 3.99078 -0.271451
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107


Object: Position- 10.4093,-1.40933 Velocity- 0.707107,-0.707107


Pings: 1:8 2:7
______________________________________________________________________
 Projectile Position: 5.98617 -0.407176
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107


Object: Position- 11.1164,-2.11644 Velocity- 0.707107,-0.707107


Pings: 1:9 2:8
______________________________________________________________________
 Projectile Position: 7.98156 -0.542901
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107


Object: Position- 11.8235,-2.82355 Velocity- 0.707107,-0.707107


Pings: 1:10 2:9
______________________________________________________________________
 Projectile Position: 9.97695 -0.678627
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107


Object: Position- 12.5307,-3.53065 Velocity- 0.707107,-0.707107


Pings: 1:11 2:10
______________________________________________________________________
 Projectile Position: 11.9723 -0.814352
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107


Object: Position- 13.2378,-4.23776 Velocity- 0.707107,-0.707107


Pings: 1:12 2:11
______________________________________________________________________
 Projectile Position: 13.9677 -0.950077
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107


Object: Position- 13.9449,-4.94487 Velocity- 0.707107,-0.707107


Pings: 1:13 2:12
______________________________________________________________________


Now that you've scrolled through it here, heres the problem.

Projectile Position: 13.9677 -0.950077
 Projectile Velocity: 1.99539 -0.135725
Turret Theta: -0.067915 Heading: 0.997695,-0.0678627
Turret Target Estimate: 8.28801,0.711987 Velocity: 0.707107,-0.707107

Object: Position- 13.9449,-4.94487 Velocity- 0.707107,-0.707107

Pings: 1:13 2:12
______________________________________________________________________

Do you see it? the boldfaced text? For some reason, the y velocity and such of my projectile isn't quite right. The X component is working perfectly, off by a hundreth of a unit? That's great considering rounding errors and such. But the y component is really not acceptable and I'm a bit of a loss as to why this is happening. Hopefully I can figure it out.

No comments:

Post a Comment