Simplify matrix calculations

 Bug: 13913604

Change-Id: I2c0f85a34e1e520050a5a6131306d6b7c352d827
5 files changed