Core dictionary version 3.0.14
_function.Closest
Name:_function.Closest
Definition:
The function
d = Closest( v, w )
returns the cell translation vector required to obtain the
closest cell-translated occurence of the vector V to the vector
W.
Type: Real
Values appear in Matrix context.
Dimension: [3]
Evaluation method:
Function Closest( v :[Matrix, Real], # coord vector to be cell translated
w :[Matrix, Real]) { # target vector
d = v - w
Closest = Int( Mod( 99.5 + d, 1.0 ) - d )
}
Category:
function


![[CIF home page] [CIF logo]](https://www.iucr.org/__data/assets/image/0015/131037/CIF_white.png)