Add trace functionality to 3x3 matrices