Structural Geology Algorithms: Vectors and Tensors