Merge branch 'feature/jaeyoung' into dev
This commit is contained in:
commit
55b29bfdd3
@ -23,8 +23,12 @@ export const defineQPloygon = () => {
|
||||
* @returns {number}
|
||||
*/
|
||||
export const calculateAngle = (point1, point2) => {
|
||||
const deltaX = Big(point2.x).minus(point1.x).toNumber()
|
||||
const deltaY = Big(point2.y).minus(point1.y).toNumber()
|
||||
const deltaX = Big(point2?.x !== undefined ? point2.x : 0)
|
||||
.minus(point1?.x !== undefined ? point1.x : 0)
|
||||
.toNumber()
|
||||
const deltaY = Big(point2?.y !== undefined ? point2.y : 0)
|
||||
.minus(point1?.y !== undefined ? point1.y : 0)
|
||||
.toNumber()
|
||||
const angleInRadians = Math.atan2(deltaY, deltaX)
|
||||
return angleInRadians * (180 / Math.PI)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user