X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsupport%2Fxform.cpp;fp=libctsupport%2Fxform.cpp;h=a8f09560d7aaa8871729db151eccbbf64b31e053;hp=cf35c4c9872bf2b2a168e58e4b5a49d3c4895b1c;hb=9ac3b88884957e2c07bf365c2503c6c1fbeaa60e;hpb=f66f845b0faf1c3a4f9bc5ad17ec3321ef62c36e diff --git a/libctsupport/xform.cpp b/libctsupport/xform.cpp index cf35c4c..a8f0956 100644 --- a/libctsupport/xform.cpp +++ b/libctsupport/xform.cpp @@ -119,6 +119,13 @@ rot_mtx2 (GRFMTX_2D m, const double theta) m[1][0] = -s; m[1][1] = c; } +void +copy_mtx2 (GRFMTX_2D to, const GRFMTX_2D from) { + for (int r = 0; r < 3; r++) + for (int c = 0; c < 3; c++) + to[r][c] = from[r][c]; +} + void mult_mtx2 (const GRFMTX_2D m1, const GRFMTX_2D m2, GRFMTX_2D result) { @@ -131,10 +138,7 @@ mult_mtx2 (const GRFMTX_2D m1, const GRFMTX_2D m2, GRFMTX_2D result) temp[row][col] += m1[row][calc] * m2[calc][col]; } } - - for (int r = 0; r < 3; r++) - for (int col = 0; col < 3; col++) - result[r][col] = temp[r][col]; + copy_mtx2 (result, temp); } void