diff --git a/src/transformations.nim b/src/transformations.nim index 2730894..a5fc613 100644 --- a/src/transformations.nim +++ b/src/transformations.nim @@ -1,6 +1,6 @@ from "./matrix" import Matrix, matrix, `*` from "./tuple" import Tuple4 -import math +from math import sin, cos proc translation(x, y, z: float): Matrix = matrix(@[1.0, 0.0, 0.0, x, 0.0, 1.0, 0.0, y, 0.0, 0.0, 1.0, z, 0.0, 0.0, 0.0, 1.0], 4, 4) @@ -42,6 +42,7 @@ when isMainModule: import unittest from "./tuple" import point, vector, `==` from "./matrix" import inverse + from math import sqrt, PI suite "transformations": test "Multiplying by a translation matrix": let transform = translation(5.0, -3.0, 2.0)