Calculate matrix transformations in Amber.