mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Master merge first attempt
This commit is contained in:
parent
1e819a2acf
commit
550c874c9b
419 changed files with 24252 additions and 3446 deletions
|
@ -152,3 +152,10 @@ export const vectorRotate = (v: Vector, a: Radians): Vector => {
|
|||
|
||||
return vector(v[0] * cos - v[1] * sin, v[0] * sin + v[1] * cos);
|
||||
};
|
||||
|
||||
/**
|
||||
* 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