Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Clone, Debug)]
- pub struct Vec3 {
- pub v: [f64; 3],
- }
- impl Sub for Vec3 {
- type Output = Vec3;
- fn sub(self, other: Vec3) -> Vec3 {
- Vec3 {
- v: [
- self.v[0] - other.v[0],
- self.v[1] - other.v[1],
- self.v[2] - other.v[2],
- ],
- }
- }
- }
- let x = Vec3 {v: [0., 0., 0.]};
- let y = Vec3 {v: [0., 0., 0.]};
- let a = x - y;
- let b = x - y;
Add Comment
Please, Sign In to add comment