You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@leafer/math

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafer/math - npm Package Compare versions

Comparing version
1.6.7
to
1.7.0
+2
-2
package.json
{
"name": "@leafer/math",
"version": "1.6.7",
"version": "1.7.0",
"description": "@leafer/math",

@@ -25,4 +25,4 @@ "author": "Chao (Leafer) Wan",

"devDependencies": {
"@leafer/interface": "1.6.7"
"@leafer/interface": "1.7.0"
}
}

@@ -288,2 +288,4 @@ import { IMatrixData, IPointData, ILayoutData, IMatrixWithLayoutData, IMatrixWithOptionScaleData, IScaleData, IMatrixWithScaleData, IScrollPointData } from '@leafer/interface'

// translate
t.e = x

@@ -290,0 +292,0 @@ t.f = y

import { IPointData, IMatrixData, IRadiusPointData, IMatrixWithScaleData } from '@leafer/interface'
import { OneRadian, PI2, getPointData } from './MathHelper'
import { OneRadian, getPointData } from './MathHelper'

@@ -8,3 +8,3 @@ import { MatrixHelper as M } from './MatrixHelper'

const { toInnerPoint, toOuterPoint } = M
const { sin, cos, abs, sqrt, atan2, min, round, PI } = Math
const { sin, cos, abs, sqrt, atan2, min, round } = Math

@@ -147,6 +147,7 @@

if (toOriginX === undefined) toOriginX = originX, toOriginY = originY
let fromAngle = atan2(fromY - originY, fromX - originX)
let toAngle = atan2(toY - toOriginY, toX - toOriginX)
const radian = toAngle - fromAngle
return radian < -PI ? radian + PI2 : radian
const a = fromX - originX
const b = fromY - originY
const c = toX - toOriginX
const d = toY - toOriginY
return Math.atan2(a * d - b * c, a * c + b * d)
},

@@ -153,0 +154,0 @@