"""
Function for coordinates manipulations
    for 3d object
    
    Returns:
        [np.array]: [matrix]
"""
import math 
import numpy as np

def translate(pos):
    tx, ty, tz = pos
    return np.array([
        [1,0,0,0],
        [0,1,0,0],
        [0,0,1,0],
        [tx,ty,tz,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]
    ])
    
    