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

@eturnity/eturnity_maths

Package Overview
Dependencies
Maintainers
5
Versions
432
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eturnity/eturnity_maths - npm Package Compare versions

Comparing version 6.29.0 to 6.30.0-qa-6.31.0

src/snap.js

2

package.json
{
"name": "@eturnity/eturnity_maths",
"version": "6.29.0",
"version": "6.30.0-qa-6.31.0",
"author": "Eturnity Team",

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

@@ -78,5 +78,4 @@ import {

let angle = Math.round(
(Math.acos((a * a + b * b - c * c) / (2 * a * b)) * 180) / Math.PI
)
let angle = (Math.acos((a * a + b * b - c * c) / (2 * a * b)) * 180) / Math.PI
//if 3 points are aligned

@@ -86,2 +85,5 @@ if (isNaN(angle)) {

}
let sgn=-Math.sign(crossProduct(substractVector(H,I),substractVector(J,I)).z)
angle=sgn*angle
return angle

@@ -88,0 +90,0 @@ }

@@ -7,2 +7,3 @@

export * from './vector';
export * from './snap';
export * from './intersectionPolygon';

@@ -9,0 +10,0 @@ export * from './objects';

@@ -0,1 +1,2 @@

import { substractVector } from "./vector"
export function inverse2x2Matrix([a, b, c, d]) {

@@ -53,2 +54,7 @@ //inverse matrix |a,c|

return product
}
export function rotateTransformation(point,angle,center){
let rotationMatrix=[[Math.cos(angle),Math.sin(angle)],[-Math.sin(angle),Math.cos(angle)]]
let k=multiplyMatrices(rotationMatrix,[[point.x-center.x],[point.y-center.y]])
return {x:k[0][0]+center.x,y:k[1][0]+center.y}
}

@@ -24,3 +24,3 @@ import {

}
export function updateOutlineFromInclineDirection(incline, direction, outline,initialAverageHeight) {
export function updateOutlineFromInclineDirection(incline, direction, outline,initialAverageHeight,isRoofOnRoof = false) {
const newNormalVector = {}

@@ -33,3 +33,2 @@ newNormalVector.x =

let meanPoint = meanVector(outline)
let minAltitude=Math.min(...outline.map(p=>p.z))
meanPoint.z=initialAverageHeight

@@ -40,4 +39,12 @@ let newOutline = outline.map((p) => {

//if some points are with negative altitude, we offset the whole roof
const newMinAltitude = Math.min(...newOutline.map((p) => p.z))
let altitudeOffset=newMinAltitude-minAltitude
let altitudeOffset
let minAltitude=Math.min(...outline.map(p=>p.z))
let maxAltitude=Math.max(...outline.map(p=>p.z))
let newMinAltitude = Math.min(...newOutline.map((p) => p.z))
let newMaxAltitude = Math.max(...newOutline.map((p) => p.z))
if(isRoofOnRoof && maxAltitude!=0){
altitudeOffset=newMaxAltitude-maxAltitude
}else{
altitudeOffset=newMinAltitude-minAltitude
}
newOutline.forEach((p) => (p.z -= altitudeOffset))

@@ -44,0 +51,0 @@

@@ -56,2 +56,9 @@ export function addVector(u, v) {

return multiplyVector(1 / length, v)
}
export function normalize2DVector(v) {
let length = vectorLength2D(v)
if (length == 0) {
return v
}
return multiplyVector(1 / length, v)
}
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