0

Using the Trigonomteric functions in the QGIS 3.1 field calculator gives me unexpected output. For example sin(180) produces the output -0.8011526357338304 instead 0.

What is the reason for this?

How do I achieve expected result using degree as input?

1
  • 2
    you need to convert your input to radians mulitply by pi/180
    – Ian Turton
    Commented Apr 21, 2020 at 15:52

1 Answer 1

3

Trigonometric functions in QGIS expressions (sin, cos, tan) expect the input angle to be specified in radians.

You can convert your input to radians using the radians function, so your example would look like this:

sin(radians(180))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.