Coder Social home page Coder Social logo

math126's Introduction

Math 126

We are rebuilding the University of Washington's online Math 126 course materials out in the open. We have just started. You can see the live course site (corresponding to the gh-pages branch of this repository) here.

Written in markdown

The course notes have been (are being!) converted into markdown format. Each numbered folder corresponds to a lecture from the course; the old lecture slides are now markdown documents. Using pandoc, these documents can be convered to a bunch of formats:

  • HTML5
  • HTML5 slideshows
  • LaTeX
  • epub

Scripted

If you look at the markdown pages, you will see chunks like this:

Question
--------

How does it feel to fly along this trefoil path?
<div id="trefoil">
  <img src="media/lecture-1-trefoil.png"></img>
</div>

<script>
(function() {
    var scene = new MathScene("trefoil");
    var trefoilFunc = function(t) {
          var t2, t3;
          t2 = t + t;
          t3 = t2 + t;
          return 41 * Math.cos(t) - 18 * Math.sin(t) - 83 * Math.cos(t2) - 83 * Math.sin(t2) - 11 * Math.cos(t3) + 27 * Math.sin(t3);
        };
    var trefoilPoint = function(t) {
          var kScale, x, y, z;
          kScale = 0.01;
          x = trefoilFunc(t);
          y = trefoilFunc(6.283185 - t);
          z = trefoilFunc(t - 1.828453);
          return new THREE.Vector3(kScale * x, kScale * y, kScale * z);
        };
    var x = function (t) { return trefoilPoint(t).x; }
    var y = function (t) { return trefoilPoint(t).y; }
    var z = function (t) { return trefoilPoint(t).z; }
    var ppath = new ParametricPathModel(x, y, z, [-4, 4], 1.3);
    ppath.embedInScene(scene);
}());
</script>

The <img> tag holds a static image that might appear in a textbook, static website, ebook, etc. The <script> tag holds javascript that adds interactive models to the HTML5-rendered document. If you convert this Markdown to LaTeX, pandoc intelligently ignores the <script> and only renders the image into the document.

Math functions provided

The files js/MathScene.js, js/marchingcubesraw.js, js/marchintetrahedraraw.js, js/surfacenetsraw/js (and others to come) give us a library of calculus-friendly client-side math functions. This library will grow as we add content and need new functions. (We will also eventually document things!) The latter three are mild modifications of files written by @mikolalysenko to compute isosurfaces. (Basically, we made them blob-friendly for the purpose of using web workers to compute the underyling geometry and keep the intensive calculations off of the main thread.)

All of the 3d rendering uses Three.js. We will eventually include more documentation about the MathScene and MathModel classes. There is nothing earth-shattering in there.

Plans

We will continuously add functionality over the next year. In the short term, we plan to:

  • make all content epub friendly
  • continue to enlarge the script collection to enable more content creation
  • improve documentation
  • abstract the framework from the content so that it is possible to easily do this with other courses

math126's People

Contributors

eccheng avatar jpswanson avatar maxlieblich avatar ohanar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

math126's Issues

Slide shows broken

Mouse interaction with items in slide shows doesn't work right.

Conjecture: I'm sticking all javascript in via pandoc at the beginning. Maybe it's better to put it at the end, after the js code for the slideshow library has been loaded.

Related: <script> tags containing interactivity should actually just be aggregated into one file that gets loaded last, so that everything is defined before models are built. This is how things worked in the old version, but I've let my testing procedure invade my production work. Fix this before it's too late!

Ebook is not present

I tried downloading the Ebook from the io website and it gave me a 404 error.

Hybridize text/lecture slides

What about putting the "explanation" content in a special tag that can be expanded/contracted upon some kind of interaction? Then one could use the materials as lecture slides and students can optionally see expanded explanations if they want to.

This might also help establish a framework for cumulative explanations/comments without creating ever-enlarging files that get more and more convoluted.

Only render when necessary

The renderloop method of a MathScene object should include some kind of interaction handlers. E.g., mouseenter event should trigger the loop, mouseleave should stop it, unless some kind of animate flag is set to true (for animations that should always be running). This is obviously not sufficient, since different kinds of devices have different interaction models.

I think WebGL knows not to keep animating offscreen content, but I'm not sure.

Auto-add animation controls

Animations eat CPU (by repeatedly calling requestAnimationFrame). It would be better to add a makeAnimated() method to MathScene that will automatically populate a gui with a switch to turn animation on and off.

Format Errors - Dot Products

In the first Practice sections, five bullets down, it reads "compute $x, y, z-1, 2, 3". It should be a dot product of two vectors.

In the Length section under "True or False?" it reads "i.e., holds for any $". This seems to be another formatting problem.

Lectures 2 and 5 have something wrong

There is a weird display bug: the first MathScene is weird. Probably in the code. Hopefully not in the interaction between jQuery, Three.js, and MathJax.

Implement surface rendering using ray marching

Rather than use marching cubes, marching tetrahedra, etc., we should try using ray marching. It might be faster without needing a webworker (since we would just push the work to the GPU via shaders).

Tricky part: we need the scalar field to evaluate. Ideally, we have a class that will write the shaders using any given expression (within limits). That means parsing math expressions into function strings that can be used in the literal text of a fragment shader.

Relevant links: A cursory glance at the internet yielded a few examples/references.

Try a demo: to do, try a demo with a single example to see if this is actually faster. (Also try this on various devices to see how it goes. My gut says pushing things to the GPU will be faster than computing the relevant arrays with a webworker and then constructing a threejs buffergeometry on the main thread. Stupid example: when I first tried computing in a webworker and then constructing an ordinary geometry by looping over the vertices, making the mesh, etc., the main thread again became hopelessly blocked. Caveat: my gut knows nothing.)

need better license

The MIT license is specific to software, however much of what we have is not code, but content. We should therefore use a better suited license at least for the markdown files -- most likely one of the creative common licenses.

MathJax doesn't work in Chrome on Android.

See here. No one seems interested in doing anything about this because they say that can't reproduce it. This seems deeply mysterious, but it basically breaks the entire modern mathematical internet for at least some users of Chrome on Android.

If this were very widespread, there would undoubtedly be much more complaining about this. All I can say is that MathJax has been broken on Chrome for Android for me for months, and the thread linked above shows that at least one other person is having this problem.

Why do we care? All of our materials use MathJax and we want them to work on mobile devices.
Why is this listed here? Because maybe somebody knows a smart way around this.

Insert static images

TODO: insert images in place of the dynamic parts for rendering. This will be easy. It would be good to make this automatic somehow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.