Sine function and calculations