Guest User

Untitled

a guest
Jan 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1.  
  2. class Vector
  3. {
  4. public Vector()
  5. {
  6. Vector(0, 0, 0);
  7. }
  8.  
  9. public Vector(float _x, float _y, float _z)
  10. {
  11. x = _x; y = _y; z = _z;
  12. }
  13.  
  14. public float x, y, z;
  15. public Vector normalized()
  16. {
  17. float magnitute = Math.sqrt(x * x + y * y + z * z);
  18. return new Vector(x / magnitude, y / magnitude, z / magnitude);
  19. }
  20. }
Add Comment
Please, Sign In to add comment