Guest User

Untitled

a guest
Jun 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. public func += (left: inout Vector3D, right: Vector3D) {
  2. left = left + right
  3. }
  4.  
  5. var initialVector = Vector3D(x: 1.0, y: 2.0, z:3.0)
  6. let vectorToAdd = Vector3D(x: 3.0, y: 4.0, z:5.0)
  7.  
  8. initialVector += vectorToAdd /* initial vector now has: x = 4, y = 6, z = 8 */
Add Comment
Please, Sign In to add comment