samibendou / meca3 Goto Github PK
View Code? Open in Web Editor NEW3D space and physics engine for point's mechanics
Home Page: https://www.npmjs.com/package/meca3
License: GNU General Public License v3.0
3D space and physics engine for point's mechanics
Home Page: https://www.npmjs.com/package/meca3
License: GNU General Public License v3.0
Description
Allow Trajectory
constructor the create constant step trajectories
Context
The static method cstStep
can already construct constant step trajectories
Acceptance criteria
Can replace cstStep
everywhere
Design
Multi-type argument step
of constructor
Description
Test all static methods
Context
Only a part of Vector3
static methods has been coded
Acceptance criteria
All methods must test simple cases
More complex methods must test edge cases
Design
Follow implementation of the tests
Description
Generators of diagonal and tri-diagonal Matrix3
Context
Construction of the matrix is made component by component
Acceptance criteria
Check identity matrix, check diag(1, 2, 3)
Design
Static method
Description
Get/set the current position and speed of a Point
object
Context
see #50
Acceptance criteria
Design
Take the last position in trajectory
and manipulate coordinates using relative vector
Description
Allow to get samples of a trajectory with a method .sample(t0, t1, n)
Context
The trajectory provides a t(s)
method which returns the duration elapsed from the beginning of the trajectory.
The trajectory provides a at(s)
method which returns the PointPair
representing the position of the point.
Note : s
is the curvilinear abscissa, a real between 0 and the number of elements in the trajectory
Acceptance criteria
With a constant step trajectory of size n
and step h
, .sample(0, n / h - 1, n)
returns the pairs
of the trajectory
Design
WIP
Description
Trajectory
has a member named origins
that should be named origin
Description
Solve ODE using Euler implicit method
Context
Current solver is designed using Euler explicit method
Acceptance criteria
Same results as Euler explicit solving
Design
Implement Euler's implicit method into Solver
class
Description
Get/set latitude and longitude of a Vector3
Context
A function property is already available for the co-latitude phi
and the angle theta
Acceptance criteria
Same behavior as phi
and theta
Design
Use spherical coordinates with the relation between co-latitude and latitude
Description
It's not possible anymore to call isEqual(0)
, replace with isZero()
Context
cos
and sin
methods in Vector3
use this deprecated feature
Description
Create an interface between Matrix
class and Javascript 1D Array
.
Context
Matrix3
class actually provides an interface with Javascript 2D Array
Acceptance criteria
Arrays can be converted to matrix and reciprocally
Design
Same as 2D arrays interface
Description
Allow step solving with trajectory and buffer trajectory objects
Context
see #6
step solving is implemented with Vector3
only
Acceptance criteria
Same result as current solving with Vector3
Design
Implement a stepFromOrigin()
method into solver
Description
Allow modules to be imported in node.js and browser.
Context
Modules can only be imported into node.js
Acceptance criteria
Import modules using require
in node and <script src="./Vector3.mjs"></script>
in browser
Design
Add each class of the module as property of window
if module
is undefined
Description
Redesign rotation matrices generators so generators return function
of angle of rotation
Context
Current generators depend on given angle returns Matrix3
objects
Acceptance criteria
Rotation matrix returned by the generator is a function of angle that returns a Matrix3
Design
Same design as makeAffine()
method
Description
Create a PointPair
by providing only a Vector3
Context
PointPair
constructor is written as follows : PointPair(origin, vector)
Acceptance criteria
Origin must be set to 0
Design
Static method
Description
Set cylindrical coordinates of a Vector3
Context
Vector3
provides a setter for spherical coordinates
Acceptance criteria
Unit tests on rxy
setter
Design
Create a rxy
setter for the rxy
property
Same as implementation style as setRThetaZ()
Description
Generate and update wiki pages automatically from code documentation
Context
Documentation is generated from code and manually using jsdoc2md and then pushed to wiki
Description
Write unit tests for PointPair
and Trajectory
geometrical transformation methods
Context
Geometrical transformations relies on Matrix3
and Vector3
addition, multiplication and liner mapping that are already tested
Acceptance criteria
Design
Write simple tests for transformations methods
Write edges cases tests and simple tests for Matrix3
and Vector3
transformations
Description
Override Javascript operators to allow addition +
, multiplication x
of Vector3
, Matrix3
and number
Context
Object oriented syntax to perform operations
Acceptance criteria
Same behavior as object oriented syntax
Regular operators +
, *
, /
Assignment operators +=
, *=
, /=
Design
WIP
Description
Allows solving by giving only the time step and the duration
Context
Solving can be performed by setting the member step and then solve a fixed number of iterations
Acceptance criteria
Same output as already implemented solver
Design
Calculate the number of samples required and use the already implemented solver
Description
Rename the property named step
or steps
which represents variable step Array
/ constant step value number
Context
Trajectory
and BufferTrajectory
names the step step
Design
Rename steps
and step
to dt
Description
Get/Set the absolute positions Vector3
of a Trajectory
Context
A getter/setter is already written for the origins
Vector3
Acceptance criteria
Same behavior as .origins
Design
Property method
Description
Create template files for Point
class and Field
Context
Implementation from scratch
Acceptance criteria
Design
https://www.lucidchart.com/documents/view/fc7489c5-a25e-426f-a0d8-7b27be15a3a5
Description
Method to exponentiate Matrix3
Context
Algebraical operations for Matrix3
are already implemented
Acceptance criteria
Check on inversion
Check on square and cubic powers
Same results as product and inversion
Design
Fast exponentiation member method of Matrix3
Handle negative values by inverting the matrix
Description
Create an interface between Matrix3
and Vector3
and Javascript string
Context
Both classes provides a toString()
method
Acceptance criteria
the output of toString()
method must be convertible to an object identical to the object that produced the string
Design
Same as 2D arrays interface
Description
Allow to use at(t)
method of a Trajectory
when t
is a real number
Context
The trajectory object has a at(t)
method but it only accepts integer values of t
that represents an index of the trajectory array.
Design
Create a method when t
is integer so the behavior does not change.
Modify at()
method in order to make linear interpolation with the values in trajectory[floor(t)]
and trajectory[ceil(t)]
.
Context
No npm keywords provided
Description
Compute derivative of Vector3
with constant step and without specifying the step
Context
Vector3.der
function allows to compute the derivative of a Vector3
array with variable step
Acceptance criteria
Allow to compute the derivative without specifying the derivation step
Allow to compute the derivative with a constant step
Design
Improve step
argument handling in Vector3.der
function.
Same default step
argument management as Trajectory.constructor
Description
Use solver to return trajectory from a fixed origin
Context
The solver has a method solve()
that returns an Array
of Vector3
representing the solution of the ODE.
Acceptance criteria
For each pair of the trajectory, the corresponding vector
object is the same as the Vector3
returned by the solve()
method
Design
Use the solve()
method and create and cstOrigin()
trajectory
Description
Create class method to compute initial conditions u0
, u1
from initial conditions u0
, v0
.
Context
The initial conditions computation is performed in solve()
method there is not method to do this
Acceptance criteria
Unit testing is functional for solver
Design
Reuse formulas given in solve()
method and create a new method to return the output of the formulas
Description
Clean syntax to remove warnings and typos
Acceptance criteria
No warnings, no typos
Design
Node.js syntax cleaning with WebStorm
Description
Construct Vector3
by given spherical and cylindrical coordinates
Context
A setter for spherical coordinates has already been coded
The setter for cylindrical coordinates has not been coded yet (#20)
Acceptance criteria
Same behavior as setters
Design
Use static generators
Description
Allow to contract and extend the steps
array
Context
The steps can only be step and get as array
Acceptance criteria
The trajectory is not changed during operation but the speed need to according to the transformation of the time step
Design
Change all steps at a time by multiplying by a scaling factor
Description
Some methods that should return a reference to this
does not actually
Context
in Vector3
class :
setRThetaPhi()
does not return this
fill()
does not return this
cross()
does not return this
in Matrix3
class :
trans()
method returns a reference to a copy of thisprod(m)
method returns a reference to a copy of thismap(u)
returns a reference to a copy to the given vector u
Acceptance criteria
All the methods that return an object of the same class of the calling object must return a reference to this
and store the result in the calling object.
map
should return a reference to the given vector which stores the output of the operation
Design
Stop copying during trans
, prod
, cross
, map
Description
Get before last PointPair
of a trajectory.
Context
last
and first
properties are implemented and return respectively last and first PointPair
.
Acceptance criteria
nexto
must be the PointPair
right before last
.
Design
Compute PointPair by calculating it directly from the pairs
properties of this
.
Description
Provide a spherical basis for Vector3
Context
The Vector3
class provides a cartesian canonical basis e(k)
, ex
, ey
and ez
getters
Acceptance criteria
Example for ex
: er(ex) == ex
, etheta(ex) == ey
, ephi(ex) == ez
Design
Use static methods
Description
Allow to contract and extend the trajectory.
Context
The pairs can only be set and get as array members
Acceptance criteria
if the trajectory is scaled by x
then the new length
of the trajectory must be x
times the old value of length
time step remains unchanged
the first point of the trajectory doesn't move
Design
change the distance between each pairs in pairs
array of a Trajectory object
Description
Finalize module interface for npm
Context
Modules has to be imported using the following syntax :
const Vector3 = require("[path_to_meca3]/Vector3.mjs");
Acceptance criteria
Modules can be imported using the following syntax :
const meca3 = require("meca3");
const Vector3 = meca3.Vector3
Unit testing can be run by the package.json
unit test entry point.
Design
Use node imports
Change .mjs
files to .js
files and add a main module file meca.js
Add a global testing interface
Description
Generators for BufferTrajectory
class that allow creating a trajectory :
PointPair
Vector3
Context
A BufferTrajectory
can be created only with a size
and a trajectory
Design
Create a new Trajectory
with implemented generators and convert it to BufferTrajectory
Description
Allow solving with variable step for Solver
class. Specify steps manually with Javascript Array
of number
Context
Solver allows constant step solving only
Acceptance criteria
Same behavior as constant step solving when specifying an Array
filled with a single value
Design
Same design as Trajectory
Description
Documentation the methods in the code and clean existing documentation
Acceptance criteria
Documentation all methods
Description
Redesign current tensor product of two vector available in Vector3
Context
current tensor product allows only to compute the tensor product of vector and itself
Acceptance criteria
Test against rotation matrix
Design
Only refacto
Description
Find tools to generate code coverage from unit tests
Context
Unit tests are already written
Description
Remove pos, speeds and accels methods from Trajectory
class.
Context
Theses function are not consistent for inherited class and wont be implemented in this module.
Description
Method to compute the mass center and the barycenter for Field
objects
Context
See #50
Acceptance criteria
Test a static system centered
Design
Linear combination comb()
Description
Length computation must be recoded since speeds
method has been deleted
Acceptance criteria
Unit tests
Description
Allow Solver
class to perform a solve with various methods
Context
The solver provides explicit Euler's method solving only
Acceptance criteria
The solver allows to use :
Design
Create a step()
method
Use a enumeration parameter to specify which solver to use when calling the step()
Description
Add getters and setters for the last and first PointPair of a trajectory
Description
Solve ODE using RK4 explicit method
Context
Current solver is designed using Euler explicit method
Acceptance criteria
Same results as Euler explicit solving
Design
WIP
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.