Issue 128410 - ASIN and ACOS return ** Faulty expression **
Summary: ASIN and ACOS return ** Faulty expression **
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: 4.1.7
Hardware: PC Windows 7
: P5 (lowest) Minor (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-29 10:09 UTC by Czesław Wolański
Modified: 2020-10-29 14:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
File with formulas and relevant screenshots (195.94 KB, application/vnd.oasis.opendocument.text)
2020-10-29 10:09 UTC, Czesław Wolański
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Czesław Wolański 2020-10-29 10:09:33 UTC
Created attachment 86982 [details]
File with formulas and relevant screenshots

In AOO Writer the following formulas:
 
=ASIN 1
=ASIN -1
=ACOS 1
=ACOS -1

return   ** Expression is faulty **

whereas in AOO Calc one can see the expected values i.e.

=ASIN(1)   returns   1.57... or  π/2 radians
=ASIN(-1)  returns  -1.57... or -π/2 radians
=ACOS(1)   returns   0
=ACOS(-1)  returns   3.14... or  π radians


Note:
Issue also observed in 4.2.0-dev
Comment 1 Regina Henschel 2020-10-29 11:12:00 UTC
It is indeed wrong for argument 1. Workaround: Write the argument of asin as 0,999999999999999

Writer and Calc use different formula engines. To make Writer use the Calc formula engine is such a large effort, that it is out of scope.
Comment 2 Czesław Wolański 2020-10-29 14:51:01 UTC
(In reply to Regina Henschel from comment #1)
> It is indeed wrong for argument 1. Workaround: Write the argument of asin as
> 0,999999999999999
> 
> Writer and Calc use different formula engines. To make Writer use the Calc
> formula engine is such a large effort, that it is out of scope.

Thank you for the clarification and workaround.

It seems that one can get the right result using relationships among the inverse trigonometric functions
( cf. https://en.wikipedia.org/wiki/Inverse_trigonometric_functions ).

The formulas for 1 / -1 argument are e.g.:

ASIN(1) = 2 * ATAN(1)
ASIN(-1) = 2 * ATAN(-1)
ACOS(1) = 2 * ATAN(0)
ACOS(-1) = π - ACOS(1)