![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
rat-vec
Advanced tools
Readme
Exact rational vector arithmetic.
rat-vec is slow but reliable. You can use it to get quickly and reliably implement geometric algorithms, then go back and smash your head into a wall trying to optimize them with filters and predicates and snap rounding and so on.
This library is built on top of bn.js
var vec = require('rat-vec')
var toFloat = require('rat-vec/to-float')
var add = require('rat-vec/add')
var sub = require('rat-vec/sub')
var dot = require('rat-vec/sub')
npm i rat-vec
A rat-vec
is an array of big-rat
s.
var r = require('rat-vec')(v)
Converts a vector of n
floating point numbers into an exact rational vector of n+1
big ints.
v
is a vector of floats, big-rat
s or stringsReturns A rational vector of big integers
require('rat-vec/is-vec')(v)
Test if v
is a rat-vec
var v = require('rat-vec/to-float')(r)
Rounds a vector of big-rats into a
r
is a vector of n
big integersReturns A vector of n
floats representing the closest representable vector
var s = require('rat-vec/add')(a, b)
Returns The vector sum of a
and b
var d = require('rat-vec/sub')(a, b)
Returns The vector difference of a
and b
var f = require('rat-vec/dot')(a, b)
Returns The dot product of a
and b
var v = require('rat-vec/muls')(a, s)
Returns The scalar product of a
and s
, where s
is a float, big-rat or string
var v = require('rat-vec/divs')(a, s)
Returns a
divided by the scalar s
var lerp = require('rat-vec/lerp')(a, b, t)
Linearly interpolate between a
and b
with parameter t
var c = require('rat-vec/cmp')(a, b)
Compares the components of a
and b
, returns an array of 0,+1,-1
whose components are the result of comparing each value.
var eq = require('rat-vec/equals')(a, b)
Test if two rational vectors are equal.
var h = require('rat-vec/max')(a, b)
Computes the component-wise maximum of a
and b
var l = require('rat-vec/min')(a, b)
Computes the component-wise minimum of a
and b
var p = require('rat-vec/mul')(a, b)
Computes the component-wise product of a
and b
var r = require('rat-vec/recip')(a)
Computes the component-wise reciprocal of a
var q = require('rat-vec/div')(a, b)
Computes the component-wise quotient of a
and b
var n = require('rat-vec/neg')(x)
Computes the additive inverse of x
var n = require('rat-vec/abs')(x)
Computes the component-wise absolute value of x
(c) 2015, MIT License
FAQs
Exact rational vector arithmetic
The npm package rat-vec receives a total of 24,625 weekly downloads. As such, rat-vec popularity was classified as popular.
We found that rat-vec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.