internal void Project(vector2[] vecs) { //matrix22 A = new matrix22(dx_X, dx_Y, dy_X, dy_Y); matrix22 A = new matrix22(dx_X, dy_X, dx_Y, dy_Y); vector2 X = new vector2( _X - dx_X / 2.0 - dy_X / 2.0, _Y - dx_Y / 2.0 - dy_Y / 2.0); for (int i = 0; i < vecs.Length; i++) { vecs[i] = X + A * vecs[i]; } }
internal bool ProjectInv(vector2[] vecs) { //matrix22 A = new matrix22(dx_X, dx_Y, dy_X, dy_Y); matrix22 A = new matrix22(dx_X, dy_X, dx_Y, dy_Y); if (!A.Inv()) { return(false); } vector2 X = new vector2( _X - dx_X / 2.0 - dy_X / 2.0, _Y - dx_Y / 2.0 - dy_Y / 2.0); for (int i = 0; i < vecs.Length; i++) { vecs[i] = A * (vecs[i] - X); } return(true); }