July 2018
Intermediate to advanced
242 pages
8h 6m
English
Now we can use the Position class together with plus and minus operators. Let's try using the minus operator:
val position1 = Position(132.5f, 4f, 3.43f)val position2 = position1 - Position(1.5f, 400f, 11.56f)print(position2)
That's it. The preceding code is going to print the following result to the console:
Position(x=131.0, y=-396.0, z=-8.13)
Read now
Unlock full access