Spaces:
Sleeping
Sleeping
File size: 311 Bytes
f23825d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
export interface IPoint {
x: number
y: number
}
export function pointSub(v1: IPoint, v2: IPoint) {
return {
x: v1.x - v2.x,
y: v1.y - v2.y,
}
}
export function pointAdd(v1: IPoint, v2: IPoint) {
return {
x: v1.x + v2.x,
y: v1.y + v2.y,
}
}
export const zeroPoint = { x: 0, y: 0 }
|