singhbhaskar / p5.js-math-library

This library to create a library for math operations.
MIT License
7 stars 2 forks source link

Project roadmap #2

Open nickmcintyre opened 5 years ago

nickmcintyre commented 5 years ago

I'm excited to see this project come to life @singhbhaskar! Let's get some ideas down for capabilities, API, development, etc., and begin to refine them.

Capabilities

p5.js has several math functions in addition to the methods defined on p5.Vector objects. You listed

IMO these are a great starting point. p5.Matrix has been implemented and could extended. Complex numbers could probably be built on p5.Vector objects. And statistics should probably work on Arrays, p5.Matrix, and Arrays of p5.Vector.

API

I think the API's for p5.js, tensorflow.js, math.js, and NumPy will be useful references.

Development

In terms of tooling, I propose using a similar environment to p5.js (Grunt, Mocha, etc.). It's probably also worth writing a few unit tests to get TDD going. Here is a Vagrantfile I used to get a development environment up and running with Vagrant and VirtualBox.

VAGRANTFILE_API_VERSION = "2"

$script = <<SCRIPT
sudo apt-get update -y
sudo apt-get upgrade -y
pushd /home/vagrant
mkdir .local
curl -o node.tar.xz https://nodejs.org/dist/v10.15.2/node-v10.15.2-linux-x64.tar.xz
tar xf node.tar.xz -C .local --strip-components=1
rm node.tar.xz
npm update -g npm
popd
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ubuntu/bionic64"
  config.vm.provider "virtualbox" do |vb|
    vb.cpus = 2
    vb.memory = 2048
  end
  config.vm.provision "shell", inline: $script, privileged: false
end
ashneeldas2 commented 5 years ago

I came up with a list of functionalities that we could implement (they range from fairly simple to much more complicated):

Linear Algebra

Simple matrix operations

Slightly more complicated matrix operations

Even harder matrix operations

Calculus

Simple operations

Slightly more complicated operations

Much harder operations

These lists are by no means anywhere CLOSE to complete – there are a bunch of other things we could implement and I would love to see this come to life.

singhbhaskar commented 5 years ago

I have add some basic Matrix operations. Matrix to Matrix multiplication is yet to be implemented and also determinant and Inverse of a Matrix. I have made all the functions static so it would not change the matrix object directly.

nickmcintyre commented 5 years ago

What do y'all think about organizing modules around common math subjects? Here's a list to start:

singhbhaskar commented 5 years ago

But algebra will have many topic under it so we have to make sperate module for those and some how bring them all together

ashneeldas2 commented 5 years ago

I like the idea of separate modules — many functionalities of certain modules may rely on functionalities of other modules, though, so we will have to have some sort of order in which we develop them. I’ve started typing up a list of topics for each of these modules and will have a more thorough list posted by tomorrow evening!

On Thu, Mar 14, 2019 at 1:38 AM singhbhaskar notifications@github.com wrote:

But algebra will have many topic under it so we have to make sperate module for those and some how bring them all together

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/singhbhaskar/p5.js-math-library/issues/2#issuecomment-472711399, or mute the thread https://github.com/notifications/unsubscribe-auth/ARTwkVnw3FUnW2RTqMcROk8-To8F4AKwks5vWeBhgaJpZM4bejum .

ashneeldas2 commented 5 years ago

modules.pdf

Here's a list of potential modules that we can add, and functionalities that might be interesting to include. I see that Bhaskar has already gotten started on linear algebra and matrices, but I can work on complex numbers and perhaps we can explore the intersections between the two (e.g. complex eigenvalues, etc.)

nickmcintyre commented 5 years ago

Great start @ashneeldas2! Per @singhbhaskar, I'm borrowing from ml5.js to set up a development environment that supports bundling–will submit a pull request when I can run tests on the modules you outlined.

singhbhaskar commented 5 years ago

It was nice meeting you guys @nickmcintyre , @ashneeldas2. I think we should implement the basic modules from scratch and provide a good support for the the modules. We can take inspirations from other libraries. And for more advanced topics we can use math.js and create a wrapper around it thus ultimately making the whole library user friendly. After this we can start working on Nick's idea for dynamic learning and create some lectures for basic mathematics that nick said in the meet, with good visualization.

nickmcintyre commented 5 years ago

Likewise @singhbhaskar! I'm intrigued by the opportunity to make the core simple enough to teach as a bridge between mathematics and a dedicated course in computer science. NOC guides the reader through implementing PVector objects from scratch. I wonder if it's feasible to set a constraint for ourselves that, given some reasonable instruction with a module, a typical high school student should be able to (mostly) implement the module on their own–no black boxes!

@ashneeldas2 let's assume we integrate math.js for more advanced topics and expose a consistent interface to p5.js users; I barely scratched the surface of this task a few weeks ago. What do you think about making a p5.js addon library also function as a math.js extension for visualization, perhaps using instance mode?

ashneeldas2 commented 5 years ago

Great meeting you both @nickmcintyre @singhbhaskar!

I can definitely see the use case of extending math.js for visualization, and I feel that doing that would allow us to benefit an even larger community of people. Using instance mode also sounds like a great idea and the matrices/complex numbers code that we already have is a good start to that. Additionally, I feel that once we hit the ground running with the math library, we can work on Dynamic Learning and make changes to both our library and to Dynamic Learning that will allow them to work well together. We should definitely make sure to keep good documentation on everything as well as stay on top of testing! I'm a fan of the idea that high school students should be able to implement modules on their own given some guidance, as I feel that really aligns with our educational objective. I'm excited to see where this will take us!