A= 30;
b= 25;
c= 40;
a =sqrt(b^2 + c^2 - 2 * b * c * cos(A));
echo ("line 56 ",A,B,C,a,b,c);
works, I guess a given value is wrong.
On 10/05/2021 22:20, lar3ry wrote:
Thanks! Got another problem with a formula. Here's a snippet
if (formula==43) {
A=given[0]; // 30
b=given[4]; // 25
c=given[5]; // 40
a =sqr(b^2 + c^2 - 2 * b * c * cos(A));
echo ("line 56 ",A,B,C,a,b,c);
and the result of the echo is:
ECHO: "line 56 ", 30, 0, 0, 242999, 25, 40
The answer should be 22.20 according to the http://cossincalc.com
http://cossincalc.com site.
nophead wrote
If you mean sin to the -1 it means arcsine, which is asin() in
openscad.
I.e. the inverse of sin.
Sent from the OpenSCAD mailing list archive
http://forum.openscad.org/ at Nabble.com.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
The square root function is sqrt(). You've got sqr().
--
Sent from: http://forum.openscad.org/
Hmm...
A= 30;
b= 25;
c= 40; a =sqr(b^2 + c^2 - 2 * b * c * cos(A));
echo ("line 56 ",A,B,C,a,b,c);
ECHO: "line 56 ", 30, 0, 0, 242999, 25, 40
This is with OpenSCAD version 2021.04.21.ai7788 (git d9d4a9757)
Exactly the same result with OpenSCAD version 2019.05
A= 30;
b= 25;
c= 40;
a =sqr((bb) + (cc) - 2 * b * c * cos(A));
echo ("line 56 ",A,B,C,a,b,c);
ECHO: "line 56 ", 30, 0, 0, 242999, 25, 40
I am unable to test with 2021.01 because on the OpenSCAD download page,
sudo apt-get install openscad
gives me 2019.05
mondo wrote
A= 30;
b= 25;
c= 40;
a =sqrt(b^2 + c^2 - 2 * b * c * cos(A));
echo ("line 56 ",A,B,C,a,b,c);
works, I guess a given value is wrong.
On 10/05/2021 22:20, lar3ry wrote:
Thanks! Got another problem with a formula. Here's a snippet
if (formula==43) {
A=given[0]; // 30
b=given[4]; // 25
c=given[5]; // 40
a =sqr(b^2 + c^2 - 2 * b * c * cos(A));
echo ("line 56 ",A,B,C,a,b,c);
and the result of the echo is:
ECHO: "line 56 ", 30, 0, 0, 242999, 25, 40
The answer should be 22.20 according to the http://cossincalc.com
<http://cossincalc.com> site.
nophead wrote
If you mean sin to the -1 it means arcsine, which is asin() in
openscad.
I.e. the inverse of sin.
Sent from the OpenSCAD mailing list archive
<http://forum.openscad.org/> at Nabble.com.
OpenSCAD mailing list
To unsubscribe send an email to
discuss-leave@.openscad
OpenSCAD mailing list
To unsubscribe send an email to
discuss-leave@.openscad
--
Sent from: http://forum.openscad.org/
That loud sound you just heard was my hand slapping my forehead!
Thanks Len!
LenStruttmann wrote
The square root function is sqrt(). You've got sqr().
--
Sent from: http://forum.openscad.org/