My Math Forum test if a point will be in a moving cone

 Algebra Pre-Algebra and Basic Algebra Math Forum

 May 19th, 2009, 08:04 AM #1 Newbie   Joined: May 2009 Posts: 6 Thanks: 0 test if a point will be in a moving cone Hi, Here is the problem I have. I have an object in a 3D environment with a cone like field of view (think of an airship or missile, its Z direction isn't necessarely leveled) moving in a constant direction. I want to know whether another object (lets suppose for now that this other object is stationary) will eventually be in the first object's field of view. I have both object's position, a vector representing the first object's direction and speed (though speed is irrelevant here since the other object is stationary), the maximum range the object can see (which, for our cone, is basically the length of the side) and the angle between the direction vector and the side of the cone. The way I see it, to test if the second object will be in the cone eventually, we first test if it's already in the cone (which is easy, simply check if the angle between the line that links both objects is equal and the velocity vector is equal or smaller than the angle we are given. If it is, check if the distance between both objects is equal or smaller than the maximum range the object can see. Now, the problem I have is the next step. If it's not in the cone right now, how do I test to see if it will be eventually? The way I saw it was to create a cylindrical corridor with a radius equal to the cone's and with the direction vector + object position as its center. Then check if the object is within that corridor and in front of the cone. I'm really not sure how to calculate that and now that I think of it, it seems there must be a simpler way, though I'm not quite sure what it is. Thank you for your help! -=edit=- ok, I figured out how to find whether or not the second object is within the corridor. Basically, you have the angle between the first object's direction vector and the line that links both objects. You also have the distance between both objects. So you can make a triangle with the distance as the hypotenuse. We can use sine to calculate the shortest distance between the second object and the cylinder's axis. If this distance is shorter than the cylinder's radius, then the second object is inside the corridor. Now, the problem is to figure out whether or not the object is in front of the cone or not. I found a way, but it requires a whole bunch of calculations . First I need to calculate the length of the cone's axis (using cos of the angle and distance between the two objects as the hypotenuse), then normalise my direction vector, then multiply it by this length, then using that new vector and the position of the first object, I get the center of the cone's base. Then I find the vector that points from the center to the 2nd object, do a dot product with the 1st object's direction vector. If that's negative, then the 2nd object is not in front of the cone. Since this is for a software, I'd really like to figure a simpler way, if there is one.
 May 22nd, 2009, 11:44 AM #2 Newbie   Joined: May 2009 Posts: 6 Thanks: 0 Re: test if a point will be in a moving cone Is my question to advanced for this forum? Should it be in one of the college math forum? (and if so, which?)
 May 22nd, 2009, 03:24 PM #3 Senior Member   Joined: May 2008 From: York, UK Posts: 1,300 Thanks: 0 Re: test if a point will be in a moving cone You can find, presumably, a point $\bf{a}=(a_1,a_2,a_3)$ and a unit vector $\bf{\hat v}=(v_1,v_2,v_3)$ which describe the position and direction of travel of your airship at time 0. This then gives an expression the position of the airship at time $t,$ namely $\bf{x}(t)=\bf{a}+ut\bf{\hat v}$ where $u$ is its speed. Given another object at a point $\bf{b}=(b_1,b_2,b_3),$ elementary geometry shows that the perpendicular distance between this object and the line travelled by the airship is given by $\left\|(\bf{b}-\bf{a})\times \bf{\hat v}\right\|,$ where $\times$ denotes the vector product. Therefore, if the radius of the cone at its widest point is given by $r,$ the point $\bf{b}$ lies within the corridor traced out by the cone for $t\in(-\infty,\infty)$ if and only if $\left\|(\bf{b}-\bf{a})\times \bf{\hat v}\right\|\leq r.$ Moreover, if the angle between $\bf{\hat v}$ and the side of the cone is $\theta,$ then $\bf{b}$ will come into the cone at some $t\in[0,\infty)$ if and only if the angle $\phi$ between $\bf{\hat v}$ and $\bf{b}-\bf{a}$ is no larger than $\theta,$ or if $\cos\phi\geq\cos\theta.$ This is equivalent to the condition $\frac{(\bf{b}-\bf{a})\cdot\bf{\hat v}}{\left\|\bf{b}-\bf{a}\right\|}\geq\cos\theta.$ Therefore your two conditions for the point $\bf{b}$ being seen eventually are $\left\|(\bf{b}-\bf{a})\times \bf{\hat v}\right\|\leq r$ $\frac{(\bf{b}-\bf{a})\cdot\bf{\hat v}}{\left\|\bf{b}-\bf{a}\right\|}\geq\cos\theta.$

 Tags cone, moving, point, test

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post Jacob0793 Real Analysis 4 March 13th, 2014 06:15 PM mathkid Calculus 9 November 11th, 2012 06:26 PM mathkid Calculus 12 October 11th, 2012 07:17 PM HellBunny Algebra 4 April 9th, 2012 05:46 PM Silvester Algebra 0 February 17th, 2009 09:29 AM

 Contact - Home - Forums - Cryptocurrency Forum - Top