Git Product home page Git Product logo

butiran-js's Introduction

butiran-js

Node package for simulation of grain-based system using molecular dynamics method and agent-based model

module

  • vect3
    • Vect3() Initialize with three, one, or zero arguments
    • strval() Get string value of a Vect3
    • add() Add some Vect3
    • sub() Substract two Vect3
    • mul() Multiply Vect3 with scalar or vice versa
    • div() Divide Vect3 with scalar
    • dot() Dot two Vect3
    • cross() Cross two Vect3
    • len() Get length of a Vect3
    • unit() Get unit vector of a Vect3
    • neg() Get negative of a vector

usage

var butiran = require("butiran");
var Vect3 = butiran.Vect3();

var a = new Vect3(3, 4, 0);
console.log(a);
console.log("a = " + a.strval());

var b = new Vect3(4, -3, 0);
console.log("b = " + b.strval());

var c = Vect3.cross(a, b);
console.log("a x b = " + c.strval());

var d = Vect3.dot(a, b);
console.log("a . b = " + d);
Vect3 { x: 3, y: 4, z: 0 }
a = (3, 4, 0)
b = (4, -3, 0)
a x b = (0, 0, -25)
a . b = 0

butiran-js's People

Contributors

dudung avatar

Watchers

 avatar

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.