X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsupport%2Fxform.cpp;h=1134f0a1d3c8c8f51bdaabecfce4d95e9253a420;hp=abf47500ad675a5b15ac96e8ac253c69d4fb5182;hb=8a7697ce57b56cdc43698cd1241ad98d49f9b5ac;hpb=12e2c29153a0f55ac23bdeec06b404638672985b diff --git a/libctsupport/xform.cpp b/libctsupport/xform.cpp index abf4750..1134f0a 100644 --- a/libctsupport/xform.cpp +++ b/libctsupport/xform.cpp @@ -1,8 +1,8 @@ /***************************************************************************** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: xform.cpp,v 1.2 2000/06/19 19:04:05 kevin Exp $ +** $Id$ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -122,24 +122,25 @@ rot_mtx2 (GRFMTX_2D m, const double theta) } void -mult_mtx2 (GRFMTX_2D m1, GRFMTX_2D m2, GRFMTX_2D result) +mult_mtx2 (const GRFMTX_2D m1, const GRFMTX_2D m2, GRFMTX_2D result) { GRFMTX_2D temp; - for (int row = 0; row < 3; row++) + for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { temp[row][col] = 0; for (int calc = 0; calc < 3; calc++) - temp[row][col] += m1[row][calc] * m2[calc][col]; + temp[row][col] += m1[row][calc] * m2[calc][col]; } + } - for (int row = 0; row < 3; row++) + for (int r = 0; r < 3; r++) for (int col = 0; col < 3; col++) - result[row][col] = temp[row][col]; + result[r][col] = temp[r][col]; } void -xform_mtx2 (GRFMTX_2D m, double& x, double& y) +xform_mtx2 (const GRFMTX_2D m, double& x, double& y) { double xt = x * m[0][0] + y * m[1][0] + m[2][0]; double yt = x * m[0][1] + y * m[1][1] + m[2][1];