Hi guys, I have a simple watch design that includes a formula, but never returns the answer I require. The formula is (cos(exp(-1)))*((sin(53.7741)) * (sin(#LAT#)) + (cos(53.7741)) * (cos(#LAT#)) * (cos(-2.76-#LNG#)). Any help or comments would be greatly appreciated. Thanks.

((cos(exp(-1))) * (sin(53.7741)) * (sin(#LAT#))+(cos(53.7741)) * (cos(#LAT#)) * (cos(-2.76-(#LNG#))))

-0.8583458494669522

Parentheses added. I used pspad (or anything that can control parentheses) to control parentheses, especially their correct opening and closing.

I donâ€™t know what it counts and whether the result is correct. But something counts.

Is that exactly how you entered the formula?

If so then I can see a couple of issues. You should not have any spaces in the formula and you need a set of brackets around the whole expression. It should be:

```
((cos(exp(-1)))*((sin(53.7741))*(sin(#LAT#))+(cos(53.7741))*(cos(#LAT#))*(cos(-2.76-#LNG#)))
```

Now a few other thoughtsâ€¦

Cos and Sin take angles in radians, whereas #LAT# and #LNG# return values in degrees. You can use the rad() function to do the conversion. eg. (sin(#LAT#)) would become (sin(rad(#LAT#)))

Likewise, you need to convert the constants in the Cos and Sin functions to radians. I donâ€™t know what your formula is meant to calculate so I donâ€™t know if the values (exp(-1)) and (-2.76) are already in radians or if you have to convert them as well.

I hope that helps a bit.

Thanks for the swift response, parentheses do indeed make a difference and also a degrees to radians conversion gives me a figure in the right ball park.

My aim is to calculate a bearing between two points, my current position and target position and thereby enable a pseudo compass for my Galaxy watch.

More work needed but thanks again guys.