On my first tutorial I did post the code, but the code viewer on Medium is a bit crappy; this way I can make it look a bit nicer, while referencing the GitHub repo as often as I can near the screenshots.
Taking out CGFloat would be good, I was trying to make everything as clear as possible but it might not be necessary there.
When I first tried just sin it was actually telling me that it only accepts Double and suggested sinf to me, I'll Double check that though (pun intended)
1. It would be much nicer if you posted actual code instead of screenshots.
2. You can drop "CGFloat" in "CGFloat.pi", since Swift will figure it out for you.
3. sin is generic on FloatingPoint, so you shouldn't have to use sinf–sin should do fine.