New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

points-3d-to-2d

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

points-3d-to-2d - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

25

index.js

@@ -14,6 +14,25 @@ var _ = require("lodash");

var p0 = $V(points3d[0]);
var p1 = $V(points3d[1]);
var p2 = $V(points3d[2]);
var p0, p1, p2;
var collinearThreshold = 0.01;
// Find first sequence of points that aren't collinear
_.each(points3d, function(point, pIndex) {
// Exit if no more points are available
if (pIndex === points3d.length - 2) {
return false;
}
p0 = $V(point);
p1 = $V(points3d[pIndex+1]);
p2 = $V(points3d[pIndex+2]);
// Colinear or near-colinear?
var cross = p0.subtract(p1).cross(p0.subtract(p2));
// Exit if non-collinear points are found
if (Math.abs(cross.e(1)) > collinearThreshold || Math.abs(cross.e(2)) > collinearThreshold || Math.abs(cross.e(3)) > collinearThreshold) {
return false;
}
});
var locOrigin = (parent.origin) ? parent.origin : p0.dup();

@@ -20,0 +39,0 @@ var locX = (parent.locX) ? parent.locX : p1.subtract(locOrigin);

2

package.json
{
"name": "points-3d-to-2d",
"version": "0.1.1",
"version": "0.1.2",
"description": "Project 3D points onto a 2D plane",

@@ -5,0 +5,0 @@ "main": "index.js",

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