< Back
Page 12 of 12
This chapter is from the book
Challenge: Vector Angle
Your Vector structure should be able to report its angle in radians. Add a read-only, computed property to it called angle.
The angle of a vector can be expressed in Swift as:
atan2(y, x)
< Back
Page 12 of 12