Guest User

Untitled

a guest
Feb 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. import numpy as np
  4.  
  5. def test():
  6. """
  7.  
  8. :rtype: test
  9. """
  10. # 平面を定義
  11. center = np.array([2, 2, 2])
  12. p1 = np.array([2, 0, 2])
  13. p2 = np.array([0, 2, 2])
  14.  
  15. vec1 = p1 - center
  16. vec2 = p2 - center
  17. cross = np.cross(vec1, vec2)
  18. print("Plane Normal", cross)
  19.  
  20. a1 = np.array([3, 3, 2])
  21. vec3 = a1 -center
  22. vec4 = np.dot(vec3, cross)
  23. print("vec4", vec4)
  24.  
  25. if __name__ == '__main__':
  26. test()
Add Comment
Please, Sign In to add comment