directory name changed

This commit is contained in:
2026-02-09 01:57:04 +01:00
Unverified
parent afc9db7a14
commit 0c562e646f
8 changed files with 1 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
import math
import numpy as np
def translate(x, y, z):
return np.array([
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[x, y, z, 1]
])
def rotate_x(a):
return np.array([
[1, 0, 0, 0],
[0, math.cos(a), math.sin(a), 0],
[0, -math.sin(a), math.cos(a), 0],
[0, 0, 0, 1]
])
def rotate_y(a):
return np.array([
[math.cos(a), 0, -math.sin(a), 0],
[0, 1, 0, 0],
[math.sin(a), 0, math.cos(a), 0],
[0, 0, 0, 1]
])
def rotate_z(a):
return np.array([
[math.cos(a), math.sin(a), 0, 0],
[-math.sin(a), math.cos(a), 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
])
def scale(n):
return np.array([
[n, 0, 0, 0],
[0, n, 0, 0],
[0, 0, n, 0],
[0, 0, 0, 1]
])