Monday, March 28, 2011

Some more thoughts on my 3D Cone

Alright, so in case you can't tell, I've figured something very important out. The sphere of range around my turret isn't really a sphere. It's more of a cone.

The XY range plane is a sphere because it stretches out to 254.929 in all directions around the turret. Next, as I shrink that XY component of my vector, the heights I can hit will increase. I mentioned this near the end of my last post. I did some thinking, and I've come to believe that there is a directly... or inverse relationship between the two. if I target an object at the end of my XY plane, then the Z height of that object when I hit it will be 0. But If I move back a bit then I can hit a target a little farther up, a little inductive reasoning later and I see the max height of my projectile show up. When can I hit the object directly overhead of my turret? When it's XY plane coordinate is (0,0). So, by this logic, I get a cone. Because of this I'm unsure if my method of comparing magnitudes of the vectors will work this time. Rather, I think I should compare the components of the vector instead. Such that, if a XY component (I'm lumping the two together, so technically I'll still be using that magnitude) and a Z component make up a ratio that is greater than... can that be expressed as a ratio? The two are inversely proportional...

If the two components added together are more than 254 than I think it's out of range. Because say some object is 100 units out on the XY plane. Obviously in range XY wise. But if the height is 200 on this particular object? Then by my proportion It's out of range because 100+200 > 254.  Also, I've worked out this example with the wonderful physics formula arctan(v^2+(or -) the square root of (v^4-g(gx^2+2yv^2))) all over gx where x and y are the distance times the cos and sin of the angle of elevation of the object. So I think I can use my proportion to test check to see if things will be out of range or not.

You might be thinking, why doesn't he just use the dang formula from wikipedia to figure it out? My answer? I need to compute these distances and calculations on estimated positions in t amounts of seconds and all that arctan square root lalala is expensive. And if a simple proportion can tell me if somethings out of range or not before I start doing calculations, I'll be quite happy. And thus, I am.

Oh, it was also my birthday yesterday

No comments:

Post a Comment