- Vector3d.get_nearest(x: Vector3d, inclusive: bool = False, tiebreak: Optional[bool] = None) Vector3d #
Return the vector in
xwith the smallest angle to this vector.
Set of vectors in which to find the one with the smallest angle to this vector.
False(default) vectors exactly parallel to this will not be considered.
If multiple vectors are equally close to this one,
tiebreakwill be used as a secondary comparison. By default equal to (0, 0, 1).
Vector with the smallest angle to this vector.
If this is not a single vector.
>>> from orix.vector import Vector3d >>> v1 = Vector3d([1, 0, 0]) >>> v1.get_nearest(Vector3d([[0.5, 0, 0], [0.6, 0, 0]])) Vector3d (1,) [[0.6 0. 0. ]]