Difference between revisions of "Projective transformation matrix"

From JSXGraph Wiki
Jump to navigationJump to search
(Created page with "<jsxgraph width="600" height="600"> var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-10, 10, 10, -10]}); // Compute a projective transformation which maps...")
 
Line 45: Line 45:
 
         for (i = 0; i < 3; i++) {
 
         for (i = 0; i < 3; i++) {
 
             for (j = 0; j < 3; j++) {
 
             for (j = 0; j < 3; j++) {
                 mat_global[i][j] = x_global[i * 3 + j];
+
                 mat_global[i][j] = x_global[i * 3 + j].toFixed(3);
 
             }
 
             }
 
         }
 
         }
  
         /*
+
         var txt = '';
         for (i = 0; i < 13; i++) {
+
         for (i = 0; i < 3; i++) {
             console.log(M[i].join(' '));
+
             txt += mat_global[i].join(' ') + '\n';
 
         }
 
         }
         console.log("solution", x_global);
+
         document.getElementById('jxg_output').value = txt;
        */
+
 
 
     };
 
     };
  
Line 75: Line 75:
 
     }
 
     }
 
</jsxgraph>
 
</jsxgraph>
 +
<html>
 +
<pre id="jxg_output" cols="50" rows="20"></pre>
 +
</html>
  
 
===The underlying JavaScript code===
 
===The underlying JavaScript code===

Revision as of 12:12, 22 July 2020



The underlying JavaScript code