Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | Namespace Members | Class Members | Related Pages

DistanceRayToRay Struct Template Reference
[XEngineMath Library]

List of all members.

Detailed Description

template<unsigned int Dimension>
struct XEngine::Math::DistanceAlgorithms::DistanceRayToRay< Dimension >

Returns the distance between the two given rays.

	The used algorithm is very similar to the segment-to-segment distance algorithm
	with the difference that there are not as many regions to examine.
	The following graph shows the possible regions. Region 0 is where s and t
	are >= 0 and that is the region where we have to find the minimum
	distance of the two rays.

	       t

	       |  
	   1   |   0
	       |
	--------------- s
	       | 
	   2   |   3  
	       |    

	For parallel rays we must determine if the direction vectors point in
	the same direction or not. If they point in the same direction the
	rays must overlap and we can easily determine the minimum distance.
	If the direction vectors point in opposite directions the rays can
	either overlap or not. If they don't overlap the minimum distance
	is the distance between the two starting points of the rays.
	


The documentation for this struct was generated from the following files: