Tightened imports
This commit is contained in:
parent
96e0c04869
commit
98abd6f193
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user