This page was coded by AI by giving the following instructions "hi, please could you help me write a web page. I'd like the page to be on the functional, technical side, and interactive, coded in javascript. The big idea is to help show how multiple transformations, represented by multiple matrices, combine. I would like a drawing area that takes the bottom two-thirds of the page. On the drawing area there should be axes, with the origin at the centre of the drawing area. The axes will be in black and quite thin, say 2 pixels thick. The user can draw with their mouse or finger on the drawing area and what they draw will be in blue. Slightly thicker I think at 3 pixels. The drawing will be recorded as a sequence of coordinates and to make the drawing look a bit nicer we will draw lines from one point to the next. There should be a 'clear' button at the left that clears the drawing area and the saved list of coordinates. On the top third of the screen there will be a sequence of 4 matrices going from left to right. These will all be 2x2 matrices and represent transformations. The matrices will default to be identity matrices. To the right of these matrices will be the result of multiplying those matrices. This resulting matrix will operate on the saved coordinates to effect the combined transformation. The result will be displayed visually on the drawing area, perhaps as a separate layer so it can be changed without interfering with the user drawn shape. This transformed result will be drawn in red, also 3 pixels width. The matrices will then be able to be changed by the user, by typing new numbers into the 4 boxes for each matrix. In addition, on top of each matrix there will be a couple of controls to enable automatic generation of the matrix below. The first (top) of these controls will be a drop-down list with the main transformation options, being a reflection in the x-axis, a reflection in the y-axis, a reflection in the line y=mx, a stretch scale factor m parallel to the x-axis, a stretch scale factor m parallel to the y-axis, a rotation about the origin of m degrees, a sheer with factor m keeping the x-axis fixed, a sheer with factor m keeping the y-axis fixed, the identity, an enlargement with scale factor m. In the second control (underneath the first control) there will be an input box to enter the value of m, which will default to 1. Whenever one of these controls is changed, the matrix below it will be set to the appropriate values that represent that transformation, and of course whenever a matrix changes, like this, or by a user changing the matrix directly by entering values, the combined transformation matrix will be updated. This result needs to be shown to the right, and then the display needs updating to show the transformed picture visually. Do you think you might be able to put something together to effect this please"
This was followed up with, "Fantastic. That's really good. Thank you. Could you adjust it however to show the 4 matrices across the page from left to right, rather than down the page. Still with the result showing at the right. I like the bounding box for these, but could those boxes have a black 3 pixel border as well please. Also, I'd like the result to be correct for the matrix multiplication, so that the first transformation will be the right-hand matrix. This is to help reinforce that idea. Thank you."
And then the code was edited slightly by hand to get the multiplication of matrices in the correct order.