all: use mach.math instead of std.math; fixes hexops/mach#1021

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-01-18 22:34:12 -07:00
parent 7904b74145
commit 89622810f8
7 changed files with 42 additions and 41 deletions

View file

@ -1,5 +1,3 @@
const std = @import("std");
const mach = @import("../main.zig");
const testing = mach.testing;
const math = mach.math;
@ -308,8 +306,8 @@ pub fn Mat(
/// Constructs a 3D matrix which rotates around the X axis by `angle_radians`.
pub inline fn rotateX(angle_radians: f32) Matrix {
const c = std.math.cos(angle_radians);
const s = std.math.sin(angle_radians);
const c = math.cos(angle_radians);
const s = math.sin(angle_radians);
return Matrix.init(
&RowVec.init(1, 0, 0, 0),
&RowVec.init(0, c, -s, 0),
@ -320,8 +318,8 @@ pub fn Mat(
/// Constructs a 3D matrix which rotates around the X axis by `angle_radians`.
pub inline fn rotateY(angle_radians: f32) Matrix {
const c = std.math.cos(angle_radians);
const s = std.math.sin(angle_radians);
const c = math.cos(angle_radians);
const s = math.sin(angle_radians);
return Matrix.init(
&RowVec.init(c, 0, s, 0),
&RowVec.init(0, 1, 0, 0),
@ -332,8 +330,8 @@ pub fn Mat(
/// Constructs a 3D matrix which rotates around the Z axis by `angle_radians`.
pub inline fn rotateZ(angle_radians: f32) Matrix {
const c = std.math.cos(angle_radians);
const s = std.math.sin(angle_radians);
const c = math.cos(angle_radians);
const s = math.sin(angle_radians);
return Matrix.init(
&RowVec.init(c, -s, 0, 0),
&RowVec.init(s, c, 0, 0),