Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lineal

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lineal

A fast and elegant vector/matrix calculation framework for JavaScript and friends

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
increased by2400%
Maintainers
1
Weekly downloads
 
Created
Source

Lineal

Lineal is a linear algebra toolkit, for easily and efficiently working with vectors and matrices. It noninvasively extends the prototype of certain arrays to give you just that bit more ease of use than its sister package gl-matrix has to offer, while having only a small and acceptable performance overhead.

npm i lineal

Usage

Lineal has a very similar API to gl-matrix, so check out their documentation for more information. In general, lineal provides static methods that return a brand-new vector or matrix and that work on any vector-like structure (i.e. not necessarily a new Vec2()), and a set of member methods that either mutate the given lineal vector or matrix, or return some kind of computed value. This all sounds more complex than it really is, so let's check out some examples.

import Vec2 from "lineal/vec2"

const v1 = new Vec2(1, 2)
v1.add([3, 4])
// v1 is now equal to [3, 6]

const v2 = Vec2.add([1, 2], [3, 4]) // returns a brand-new Vec2([3,6])
v2.length() // returns 6.7082039325

That's it! Documentation is coming soon; for now you can just read the source code, which is not difficult to read. If you found any bugs, please report them in the issue tracker so they can be fixed. Have fun programming!

Keywords

FAQs

Package last updated on 28 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc