aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-08 19:33:49 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-08 19:33:49 -0400
commitf86cc6549ff6075c3963fce819391d8d8d6960dc (patch)
tree53c6b3dafcdee1d129b09791c3e8b773ff1ac365 /examples
parent6d986e1f0419ff76e4ba4b83832a1ae6b7b6e890 (diff)
Bugfixes
Diffstat (limited to 'examples')
-rw-r--r--examples/vectors.tm14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/vectors.tm b/examples/vectors.tm
index 9f0ef20d..8560f9df 100644
--- a/examples/vectors.tm
+++ b/examples/vectors.tm
@@ -27,10 +27,10 @@ struct Vec2(x,y:Num):
return v
len := v:length()
return Vec2(v.x/len, v.y/len)
- func mix(v,other:Vec2, amount:Num)->Vec2:
+ func mix(a,b:Vec2, amount:Num)->Vec2:
return Vec2(
- v.x:mix(other.x, amount),
- v.y:mix(other.y, amount),
+ amount:mix(a.x, b.x),
+ amount:mix(a.y, b.y),
)
struct Vec3(x,y,z:Num):
@@ -58,11 +58,11 @@ struct Vec3(x,y,z:Num):
return v
len := v:length()
return Vec3(v.x/len, v.y/len, v.z/len)
- func mix(v,other:Vec3, amount:Num)->Vec3:
+ func mix(a,b:Vec3, amount:Num)->Vec3:
return Vec3(
- v.x:mix(other.x, amount),
- v.y:mix(other.y, amount),
- v.z:mix(other.z, amount),
+ amount:mix(a.x, b.x),
+ amount:mix(a.y, b.y),
+ amount:mix(a.z, b.z),
)