diff options
| author | kj_sh604 | 2026-06-05 16:07:29 -0400 |
|---|---|---|
| committer | kj_sh604 | 2026-06-05 16:07:29 -0400 |
| commit | 0e803cb3a9b5ba3a7a3085dd6eb5e05addad341d (patch) | |
| tree | 8f1f7bb9d98a7e6ae10cb65a8c207ee51639290a /src/math.zig | |
| parent | 43dfd948be1788716d9e3e4f22772d90aed24185 (diff) | |
refactor: src/math.zig
Diffstat (limited to 'src/math.zig')
| -rw-r--r-- | src/math.zig | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/math.zig b/src/math.zig deleted file mode 100644 index a9e9e23..0000000 --- a/src/math.zig +++ /dev/null @@ -1,32 +0,0 @@ -pub const Vec2f = struct { - x: f32 = 0, - y: f32 = 0, - - pub fn init(x: f32, y: f32) Vec2f { - return .{ .x = x, .y = y }; - } - - pub fn add(self: Vec2f, other: Vec2f) Vec2f { - return .{ .x = self.x + other.x, .y = self.y + other.y }; - } - - pub fn sub(self: Vec2f, other: Vec2f) Vec2f { - return .{ .x = self.x - other.x, .y = self.y - other.y }; - } - - pub fn mul(self: Vec2f, s: f32) Vec2f { - return .{ .x = self.x * s, .y = self.y * s }; - } - - pub fn div(self: Vec2f, s: f32) Vec2f { - return .{ .x = self.x / s, .y = self.y / s }; - } - - pub fn length(self: Vec2f) f32 { - return @sqrt(self.x * self.x + self.y * self.y); - } - - pub fn abs(self: Vec2f) Vec2f { - return .{ .x = @abs(self.x), .y = @abs(self.y) }; - } -};
\ No newline at end of file |
