Fix issue calculation for sin and cos