Advertisement
Guest User

Untitled

a guest
Feb 1st, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. def project_vectors_table_on_z_axis(vectors: np.ndarray) -> np.ndarray:
  2.     projection_vectors = np.zeros_like(vectors)
  3.     projection_vectors[:, 2] = 1
  4.  
  5.     vectors *= projection_vectors
  6.     vectors = (vectors[:, 0] + vectors[:, 1] + vectors[:, 2]).reshape((-1, 1))
  7.     zero_axis = np.zeros_like(vectors)
  8.  
  9.     vectors = np.hstack((zero_axis, zero_axis, vectors))
  10.  
  11.     return vectors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement