To use this module, it’s enough to create one instance of CDetector and use the function CDetector.detect (vector).

Classes:
CDetector
CLayer

CDetector:
Functions:
__init__()
detect (vector)

__init__():
Creates 5 instances of CLayer with initvalues {100, 110, 120, 130, 140} which represents the (z-)position of the Layers.

detect (vector):
Loop over all Layers the function CLayer.detect (vector).
Arguments:
vector: Tuple of 3 Numbers describing a vector
Return:
Returns a List of 5 Tuples, each Tuple has 3 Numbers: (i, j, Position)
(i,j) are the Number of the hit grid. It is numbered like a matrix – (1,1) in the upper left to (40.000,40.000) in the lower right corner
Position returns the Position of the Layer (z-coordinate)
If a Layer is not hit, the Tuple is “None”

CLayer:
Functions:
__init__(Position)
detect (vector)

__init__(Position):
Just copy the argument.
Arguments:
Position: Location of the Layer at the z-axis

detect (vector):
Calculate which grid of this Layer is hit.
Arguments:
vector: Tuple of 3 Numbers describing a vector
Return:
Returns a Tuple with 3 Numbers: (i, j, Position)
(i,j) are the Number of the hit grid. It is numbered like a matrix – (1,1) in the upper left to (40.000,40.000) in the lower right corner
Position returns the Position of the Layer (z-coordinate)
If this Layer is not hit, the Tuple is “None”