Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vector
- {
- public Vector()
- {
- Vector(0, 0, 0);
- }
- public Vector(float _x, float _y, float _z)
- {
- x = _x; y = _y; z = _z;
- }
- public float x, y, z;
- public Vector normalized()
- {
- float magnitute = Math.sqrt(x * x + y * y + z * z);
- return new Vector(x / magnitude, y / magnitude, z / magnitude);
- }
- }
Add Comment
Please, Sign In to add comment