enkimute / ganja.js

:triangular_ruler: Javascript Geometric Algebra Generator for Javascript, c++, c#, rust, python. (with operator overloading and algebraic literals) -
MIT License
1.52k stars 107 forks source link

1D/2D grid is upside down #107

Closed kungfooman closed 3 years ago

kungfooman commented 3 years ago

image

Test code:

// Create a complex Algebra.
Algebra(0,1,()=>{
  document.body.innerHTML = "";
  var canvas = this.graph((x)=>{
    // parabola at 0.2
    return x*x + 0.2;
  }, {
      grid: true
  });
  document.body.appendChild(canvas);
});

2D test case:

image

document.body.innerHTML = "";
// Create a complex Algebra.
Algebra(0,1,()=>{
  document.body.innerHTML = "";
  var canvas = this.graph((x,y)=>{
    // parabola at 0.2
    return y > x*x + 0.2;
  }, {
      grid: true
  });
  document.body.appendChild(canvas);
});