Skip to content

Commit

Permalink
feat: enhance utils
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciNyan committed Feb 23, 2024
1 parent 0806fbf commit 078383c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/pixel-profile/src/utils/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export function add2(a: Vec2, b: Vec2): Vec2 {
return [a[0] + b[0], a[1] + b[1]]
}

export function subtract2(a: Vec2, b: Vec2): Vec2 {
return [a[0] - b[0], a[1] - b[1]]
}

export function dot2(a: Vec2, b: Vec2): number {
return a[0] * b[0] + a[1] * b[1]
}

export function prod2(v: Vec2): number {
return v[0] * v[1]
}

export function subtract2(vec1: Vec2, vec2: Vec2): Vec2 {
return [vec1[0] - vec2[0], vec1[1] - vec2[1]]
}

0 comments on commit 078383c

Please sign in to comment.