Git Product home page Git Product logo

vectorfield's Introduction

2D Vector Field Visualization

Why This Was Created

There are tons of great tools online to supplement mathematics instruction, and great tools are necessary for visualizing abstract concepts. While teaching Multivariable Calculus to high school students, I wanted an easy way for my students to visualize a two-dimensional vector field.

To this point in the course, Desmos and CalcPlot3D have sufficed. When we began to study curl, I wanted to build my students' intuition via the fluid flow interpretation of a vector field. My search for existing tools turned up nothing dynamic, and the closest thing I could find was an animation in a Khan Academy video about curl. (I should mention that this video's presenter is the same fellow doing the 3Blue1Brown videos that provide amazing visual explanations and intuition for quite abstract mathematical concepts.) I required more options and control, so this project was born.

Demo

https://mbwatson.github.io/vectorField

Description

You will see the vectors representing a vector field over the square [-5,5]x[-5,5] in the xy-plane. You will also see a particle system arranged evenly about the square. The particles flow according to the forces imposed on them by the vector field.

Controls

Buttons

There are several buttons allowing you to...

  • Start and stop the animation
  • Empty the particle system of its particles
  • Reset to particle system with particles at regularly spaced intervals on the plane
  • Show and hide particle system (they are still moving if unpaused, just invisible)
  • Show and hide vectors
  • Show and hide coordinate Axes
  • Show and hide the grid lines

Preset Vector Functions

Particles on the two-dimensional surface animate according to the forces imposed on them from the current vector field. This vector field can be changed, but only to a handful of preset ones as of this writing.

Mouse

With the mouse, you can add new particles to the particle system by clicking and dragging on the plane.

In addition, you can change the animation speed by scrolling over the plane.

Todo List

There are many additions that would make this more useful as an instructional tool, which will be added as the time becomes available. A few of the most pressing issues are below.

  • Redrawing the vectors every frame is to much unnecessary work, so layer two Canvas elements:

    • (1) background plane consisting of vectors, axes, and grid and
    • (2) the particle system.
  • Change viewport

    • Grab and translate the plane to investigate other portions of the vector field.
    • Zoom in and out
  • Use MathQuill to allow users to enter their own vector functions.

  • Adjust vector and particle spacing and size on the fly.

vectorfield's People

Contributors

mbwatson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

rickeyestes

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.