rosofo / vector-fun

vector fields site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vector-fun

Live Site

Description

A small experiment with vector fields in paper.js.

I started by reading and watching material on linear algebra and vector fields. Then I wrote a renderer for the vectors, choosing evenly spaced points and drawing the vector at that point with an arrow. I then moved on to writing a particle simulator which treats the vectors as velocities. Overlaying these systems gives some pleasing visuals.

The final set of examples features such things as cursor tracking, calculating the angle of vectors such that they form curves in the space, color changes, sine functions, and particle respawning.

The bulk of the project took one week to complete as a javascript novice.

Notes

  • vectors must be on the left side of a multiplication due to js typing quirks
  • when the error 'this.x is not a function' is raised, make sure all constructors have a `new` keyword

TODOs

DONE Read about vector fields

DONE Read about manipulating vectors in paperjs

DONE Find out how to draw arrows in paperjs

use paths (i.e. it's manual) CLOSED: [2019-05-27 Mon 18:29]

About

vector fields site

License:MIT License


Languages

Language:JavaScript 99.5%Language:HTML 0.5%