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

r-geometric

v2.0.1

Published

``` javascript npm install r-geometric ```

Downloads

8

Readme

r-geometric

Installation

npm install r-geometric

Use

import RGeometricObject from 'r-geometric';

const RGeometric = new RGeometricObject();

getLength()

get line object as parameter and returns number as length of line.
let length = RGeometric.getLength({x1:10,y1:10,x2:20,y2:-40});
//returns 50.99019513592785

[alt text]

getAngle()

get line object as parameter and returns number as angle of line.
let angle = RGeometric.getAngle({x1:10,y1:10,x2:20,y2:-40});
//returns 281.309932

[alt text]

getMeet()

get 2 lines object as parameters and returns number as meet point(array of 2 number) of lines.
let meet = RGeometric.getMeet({x1:10,y1:10,x2:20,y2:-40},{x1:100,y1:-10,x2:40,y2:50});
//returns [-7.5, 97.5]

[alt text]

getPrepToLine()

get a line object and a point array as parameters and returns a point array as prependicular from point to line.
let prep = RGeometric.getPrepToLine({x1:10,y1:10,x2:20,y2:-40},[-60,-40]);
//returns [x, y]

[alt text]

getXOnLineByY()

get a line object and x value as parameters and returns a number as y .
let x = RGeometric.getXOnLineByY({x1:10,y1:10,x2:20,y2:-40},20);
//returns x

[alt text]

getYOnLineByX()

get a line object and y value as parameters and returns a number as x .
let y = RGeometric.getYOnLineByX({x1:10,y1:10,x2:20,y2:-40},20);
//returns y

[alt text]

getLineBySLA()

get a point array and length value and angle as parameters and returns a line object .
in this example this function returns a line object by start from 0,0 and length equal 20 and angle equal 45.
let y = RGeometric.getYOnLineByX([0,0],20,45);
//returns {x1:...,y1:...,x2:...,y2:...}

[alt text]

getPointsByDivide()

get a line object and divide value as parameters and returns midpoints array .
in this example , This function divides the line into 6 equal parts by return 5 mid points.
let midPoints = RGeometric.getPointsByDivide({x1:0,y1:0,x2:100,y2:60},6);
//returns [[x,y],[x,y],[x,y],[x,y],[x,y]]

[alt text]

getParallelPoints()

get array of points and offset value (number) as parameters and returns parallel points array .
let parallelPoints = RGeometric.getParallelPoints([[x1,y1],[x2,y2],[x3,y3],[x4,y4],[x5,y5]],30);
//returns [[a1,b1],[a2,b2],[a3,b3],[a4,b4],[a5,b5]]

[alt text]