boolean showVertexIds=true, showVertices=true; void myActions() { // actions to be executed at each frame if ((mousePressed)&&(keyPressed)) dragPolygon(); stroke(cyan); fill(yellow); drawPolygon(loopIsClosed); noFill(); if (showVertices) {stroke(orange); fill(white); showPoints(3); noFill(); }; if (showVertexIds) {fill(dblue); drawPointIDs(); noFill(); }; if ((mousePressed)&&(!keyPressed)) dragAB(); checkAB(); showAB(); if (!stabbed(A,B)) {stroke(dblue); A.to(B);} else { stroke(cyan); A.to(B); stroke(blue); A.makeVecTo(B).makeUnit().showArrowAt(A,50); }; //************************************************************************************************************************** //******* compute and display point Q where ray(A,B) hits the polygon and the reflection vector R (shown at Q scaled by 50) //************************************************************************************************************************** } // end my actions