cdx
Class Motion

java.lang.Object
  extended by cdx.Motion

public class Motion
extends java.lang.Object

Objects of the Motion class provide all a-priori known information about what the Aircraft was doing between two frames. Also provides methods to do useful things with this object (so it's not just dead data).


Constructor Summary
Motion()
          Constructor
Motion(Aircraft _aircraft, Vector3d _pos)
          Initialise with an aircraft and one position.
Motion(Aircraft _aircraft, Vector3d _pos_one, Vector3d _pos_two)
          Initialise with an aircraft and two positions.
 
Method Summary
 void copyfrom(Aircraft _aircraft, Vector3d _pos_one, Vector3d _pos_two)
          Copy the value of another motion to this motion.
 Vector3d findIntersection(Motion other)
          Find an intersection between this Motion and another Motion.
 Aircraft getAircraft()
          Retrieve the aircraft.
 Vector3d getFirstPosition()
          Retrieve the first position.
 Vector3d getSecondPosition()
          Retrieve the second position.
 java.lang.String toString()
          Convert a motion to a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Motion

public Motion()
Constructor


Motion

public Motion(Aircraft _aircraft,
              Vector3d _pos_one,
              Vector3d _pos_two)
Initialise with an aircraft and two positions.

Parameters:
_aircraft - aircraft
_pos_one - first position
_pos_two - second position

Motion

public Motion(Aircraft _aircraft,
              Vector3d _pos)
Initialise with an aircraft and one position.

Parameters:
_aircraft - aircraft
_pos - first position that equals to the second one
Method Detail

getAircraft

public Aircraft getAircraft()
Retrieve the aircraft.


getFirstPosition

public Vector3d getFirstPosition()
Retrieve the first position.


getSecondPosition

public Vector3d getSecondPosition()
Retrieve the second position.


toString

public java.lang.String toString()
Convert a motion to a string

Overrides:
toString in class java.lang.Object

copyfrom

public void copyfrom(Aircraft _aircraft,
                     Vector3d _pos_one,
                     Vector3d _pos_two)
Copy the value of another motion to this motion.

Parameters:
_aircraft - aircraft in the target motion
_pos_one - first position
_pos_two - second position

findIntersection

public Vector3d findIntersection(Motion other)
Find an intersection between this Motion and another Motion.

Returns:
a Vector3d object with the intersection point if an intersection was found, null otherwise.