mirror of
https://github.com/PetroProtsyk/SSharp
synced 2026-06-08 12:11:10 +00:00
11 lines
220 B
Plaintext
11 lines
220 B
Plaintext
function DotProduct(a,b){
|
|
return a.x*b.x + a.y*b.y;
|
|
}
|
|
|
|
function Scale(a, s){
|
|
return [x->a.x*s, y->a.y*s];
|
|
}
|
|
|
|
|
|
Test.AreEqual(19, DotProduct([x->1, y->3], [x->4, y->5]));
|
|
Test.AreEqual(5.1, Scale([x->0.51, y->3], 10).x); |