mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: image cropping (#8613)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
eb09b48ae6
commit
e957c8e9ee
36 changed files with 2199 additions and 92 deletions
|
@ -139,3 +139,10 @@ export const vectorNormalize = (v: Vector): Vector => {
|
|||
|
||||
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