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

DistancePointToSphere Struct Reference
[XEngineMath Library]

List of all members.

Detailed Description

Returns the distance of the given point to the given sphere. The sphere is treated as being hollow.

	Let |X - C|^2 = r^2 be the sphere and P the point. The distance between 
	the point P and the hollow sphere is abs(|P - C| - r).
	Let D = (P - C) / |P - C|, then the closest point on the sphere to P is
		Q = C + r * D
	If P = C, then the closest point on the hollow sphere to P is any point
	of the sphere, for example C + r * (1, 0, 0).
	


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