No description
Find a file
2021-02-18 20:38:06 +01:00
cypress Added webpack, eslint and first cypress test. Improved file structure and added imports 2021-02-15 18:11:52 +01:00
src fixed performance problem on resize 2021-02-18 20:38:06 +01:00
.eslintrc.js Added webpack, eslint and first cypress test. Improved file structure and added imports 2021-02-15 18:11:52 +01:00
.gitignore Added webpack, eslint and first cypress test. Improved file structure and added imports 2021-02-15 18:11:52 +01:00
cypress.json Added webpack, eslint and first cypress test. Improved file structure and added imports 2021-02-15 18:11:52 +01:00
index.html Added webpack, eslint and first cypress test. Improved file structure and added imports 2021-02-15 18:11:52 +01:00
package-lock.json so far unsuccesful attempt to introduce laziness. checking this in and then start refactoring some stuff that's in the way 2021-02-18 17:08:53 +01:00
package.json Added webpack, eslint and first cypress test. Improved file structure and added imports 2021-02-15 18:11:52 +01:00
README.md finally got it to work: add a lazily updated vector that is automatically rerun when one of its elements is updated. 2021-02-18 18:52:46 +01:00
screenshot.png moved it 2021-02-12 18:13:56 +01:00
webpack.config.js Added webpack, eslint and first cypress test. Improved file structure and added imports 2021-02-15 18:11:52 +01:00

MatRepl

  • is a Matrix
  • and a repl: ReadEvalPrint Loop, where Print is doing operations on vectors and matrices in a graphic environment
  • written in vanilla javascript (ES6)

add 2 vectors

The repl has the following syntax (It's work in progress, new capabilities will be added)

  • arithmetic expressions:
    • add, subtract, divide, multiply
  • variable declaration eg: a= ...
  • vector(1,2,3,4) adds a vector
    • > vector@0{x0:1, y0: 2, x:3, y:4}

  • remove(x) removes bindings (when it's an object (eg vector), removes it from the matrix)
  • remove(@x) removes an object using it's assigned index
  • method calls:
    • a = vector(0,0,12,1)

    > vector@0{x0:1, y0: 2, x:12, y:1}

    • a.type()

    > vector

  • property lookup
    • a.x+1

    > 13

  • drag vectors using the mouse pointer. You can change the vector arrows visually
  • lazy evaluation. The difference between c = a+b and c = "a+b" is that the latter assigns to c a parsed expression that can always be evaluated later. When you apply lazy evaluation and later update a, the value for c will be reevaluated automatically. Combined with vector dragging, this way you can get an intuition for vector addition. Want to do the same for matrix multiplication and basis change.

To run locally

  • make sure you have node/npm
  • cmdline: npm run start
  • enter the following:
    a=vector(0,0,0.5,0.5)
    b=vector(0,0,-1,1)
    c="a+b" 
    
  • and press enter. Then using the mouse pointer move a or b. (Labels will be added).
  • or type help()