Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. P = np.random.random((10,3))
  2.  
  3. Ax_support = array([3,2,1])
  4. Ax_direction = array([1,2,3])
  5.  
  6. P_centered = P - Ax_support
  7.  
  8. P_projected = P_centered.dot(np.linalg.pinv(
  9. Ax_direction[np.newaxis, :])).dot(Ax_direction[np.newaxis, :])
  10.  
  11. distances = np.sqrt(((P_centered - P_projected) ** 2).sum(axis=1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement