1
0

Tightened imports

This commit is contained in:
neviyn 2020-11-08 22:23:01 +00:00
parent 96e0c04869
commit 98abd6f193

View File

@ -1,6 +1,6 @@
from "./matrix" import Matrix, matrix, `*` from "./matrix" import Matrix, matrix, `*`
from "./tuple" import Tuple4 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) 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 import unittest
from "./tuple" import point, vector, `==` from "./tuple" import point, vector, `==`
from "./matrix" import inverse from "./matrix" import inverse
from math import sqrt, PI
suite "transformations": suite "transformations":
test "Multiplying by a translation matrix": test "Multiplying by a translation matrix":
let transform = translation(5.0, -3.0, 2.0) let transform = translation(5.0, -3.0, 2.0)