npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

Iโ€™ve always been into building performant and accessible sites, but lately Iโ€™ve been taking it extremely seriously. So much so that Iโ€™ve been building a tool to help me optimize and monitor the sites that I build to make sure that Iโ€™m making an attempt to offer the best experience to those who visit them. If youโ€™re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, ๐Ÿ‘‹, Iโ€™m Ryan Hefnerย  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If youโ€™re interested in other things Iโ€™m working on, follow me on Twitter or check out the open source projects Iโ€™ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soonโ€“ish.

Open Software & Tools

This site wouldnโ€™t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you ๐Ÿ™

ยฉ 2024 โ€“ย Pkg Stats / Ryan Hefner

rakam

v1.0.0-2

Published

Math library focusing on the performance ๐Ÿš€.

Downloads

22

Readme

RAKAM โž• โž— ๐Ÿ“

NPM Package Build Status License

Rakam or (ุฑู‚ู…) in Arabic, which means "number". This is a math library. One of the reasons to give this package a try is that, the performance is in our considerations. As some great projects such as plotto and desmos make intense calculations in tons of iterations to generate the graph. The need of such an open-source project cares about these situations arises, so that we can cooperate and contribute to reach the optimal performance ๐Ÿš€.

Features:

  • Compile math expression from a string into js function, ready for evaluation, considering the performance as the main goal.
  • Parse math expression.
  • The same for latex.
  • Convert between latex and math expression.
  • Geometric shapes and properties and intersections: now lines are avaliable.
  • Get a float number as a numerator over a denomerator { s: sign<1|-1>, n: integer, d: integer }.
  • As well as getting the quotient, the reminder and the denomerator of a fraction, { s: sign<1|-1>, q: integer, r: integer, d: integer }. AKA: quotient is the whole number, and the decimal part will be converted to a numerator and a denomerator.

You can get any import any of the APIs elements directly, saving load time and bundle size.

Documentations tree (API):

  • core lcm, gcd, lcm2, gcd2, dist, constrain, trunc, toFixed, random, randomInt
  • engine
    • math2js
    • math2latex
    • mathParser
    • latexParser
    • latex2js
    • latex2math
  • geometry
  • fraction

๐Ÿ›  engine

math2js

Rakam uses @scicave/math-parser library to parse math expression, then handle the AST, or say the parser tree, to generate the equivalent js code, in a very customizable way. After all of these steps, we easily use Function constructor, new Function(...).

See documentations for more about math2js.

๐Ÿ“ geometry

angles

You can:

  • Convert angles from unit to another one (e.g. from deg to red, or rad to grad, etc...).
  • Calculate the angle between two vectors, { x: number, y: number }. You can also calculate the angle between two lines.
  • In both cases, between vectors or lines, you can get the minimal or maximal angle or get the angle by which the first vector (or line) rotates to reach the other vector (or line).
  • Calculate the angle in degree (as float number), and get it as {deg: number, min: number, sec: number}, degree, minutes and seconds respectively.
  • Or get it as 12ยฐ 26' 53.48"

Documentations: angles.

lines

You can:

  • Get a line equation parameters: "a", "b" and "c" in ax + by + c = 0 .
  • Get the 2 lines intersection point.
  • Project a point onto a line.
  • Get the distance between a point ad a line.

Documentations: lines

โž— fraction

Documentation: fraction

๐Ÿ“œ License

Copyright (ยฉ) 2020 sciCaveโ„ข [email protected]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.