03/12/2011, 07:58 PM  #1 
Little Clucker
Join Date: Nov 2011
Posts: 3
Reputation: 0

How to know if a vector passes over a dot
I know how to get the distance with cross product, but I don't know that.
I want to know when a vector passes over a dot, in a "x y z" position. I don't know too much of physics. 
04/12/2011, 01:49 AM  #2 
Little Clucker
Join Date: Nov 2011
Posts: 3
Reputation: 0

Respuesta: How to know if a vector passes over a dot
Nobody answers?
I need it please. 
04/12/2011, 02:32 AM  #3 
Highroller
Join Date: Mar 2008
Location: New Zealand
Posts: 2,629
Reputation: 410

Re: How to know if a vector passes over a dot
OK, I take it you mean find if the line crosses a certain point. I'm not fully sure on 3d scales but I know how to do 2d using just x and y.
So, all we need to do is find the equation of the line then plug our values into that line to see if it is anywhere on there. We are going to need to find the gradient (y2  y1 / x2  x1) and the equation formula y  y1 = m(x  x1). An example is the line with the points (2, 5) and (6, 9). We are going to find if the point (3 , 6) lies on that line. Code:
gradient = (9  5) / (6  2) = 4 / 4 = 1 Equation y  y1 = m(x  x1) y  5 = 1(x  2) y  5 = x  2 y = x + 3 Then plug in our values. 6 = 3 + 3 6 = 6 The point is on our line pawn Code:
Hope this helps . 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
[Plugin] CSTL  Data container(s) (Currently vector)  Teprey  Plugin Development  64  12/12/2015 10:36 PM 
Setting an object rotation by the player's camera vector?  [XST]O_x  Scripting Help  3  14/07/2012 02:03 PM 
[HOW]Hour passes and he/she gets +1 Score???  vakhtang  Help Archive  1  19/03/2011 01:32 PM 
[Discussion] New Hack which passes callbacks? (related to scripting)  PoWerZ  Help Archive  1  13/10/2009 07:43 PM 