%%%%%%%%%%%%%%%%%%%%% Reflection in a triangle side %%%%%%%%%%%%%%%%%%%%% % % TRIREFL % Usage: TRIREFL(tri,side) % Inputs: tri - a vector who components are the vertices of a triangle % side - the side of the triangle in which to reflect % side must be one of 'a', 'b' or 'c' or 'A' 'B' or 'C' % the upper case designation is used to denote a reflection % whwere the resulting tiangle is not drawn % % Output: vertices of the reflected triangle % % if [A, B, C] are the vertices and a, b, c are the opposite sides % then action is as follows: % % reflecting side fixed vertices changed vertex % % a C, B A % b A, C B % c A, B C function T = trirefl(tri,side) if (side == 'a')|(side == 'A') perm = [3 2 1]; end; if (side == 'b')|(side == 'B') perm = [1 3 2]; end; if (side == 'c')|(side == 'C') perm = [1 2 3]; end; tri = tri(perm); P = tri(1,1); Q = tri(1,2); R = tri(1,3); R = reflect([P Q],R); T = [P Q R]; T = T(perm);