Issue 128410

Summary: ASIN and ACOS return ** Faulty expression **
Product: Writer Reporter: Czesław Wolański <czeslaw.wolanski>
Component: uiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Minor    
Priority: P5 (lowest) CC: rb.henschel
Version: 4.1.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
File with formulas and relevant screenshots none

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)