How to calculate sine

How to calculate the sine of 1? like sin(1)

thanx! but i cant find the way to calculate it anyway. i just started to learn swift and i got a task to improve my skills in google solutions of tasks we have not yet studied. so i have to find the sine of 1 using Swift. i found how to calculate sine of 90 degrees but i cant find how to calculate sine of 1

and should i also import smth before calculating sine of 1?

You can alternatively use the one provided in Foundation:

import Foundation

sin(1.0)  // returns 0.8414709848078965

yeeeeeeees !!!!! it worked!!! thanx!!!

Even though you got an answer now, I would encourage you to actually spend at least an hour or two trying to research these things for yourself instead of asking others. Especially if the assignment is explicitly about googling things. Being able to find solutions in areas you're not closely familiar with is (imo) one of if not the most important skill a programmer can have, and you won't get better without actually doing it.

1 Like

thanx for advise. i spend a lot of time to find solution, but failed. i thought that to find the answer on a forum is the same thing as googling. but i guess now you are right, i have to google better