mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: Remove GA code from binding (#9042)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
31e8476c78
commit
0ffeaeaecf
44 changed files with 2112 additions and 1832 deletions
|
@ -137,12 +137,9 @@ export function vectorMagnitude(v: Vector) {
|
|||
export const vectorNormalize = (v: Vector): Vector => {
|
||||
const m = vectorMagnitude(v);
|
||||
|
||||
if (m === 0) {
|
||||
return vector(0, 0);
|
||||
}
|
||||
|
||||
return vector(v[0] / m, v[1] / m);
|
||||
};
|
||||
|
||||
/**
|
||||
* Project the first vector onto the second vector
|
||||
*/
|
||||
export const vectorProjection = (a: Vector, b: Vector) => {
|
||||
return vectorScale(b, vectorDot(a, b) / vectorDot(b, b));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue