Appendix calculator
lordofbikes opened this issue · 1 comments
Regarding pull request #104 I propose some more changes for https://github.com/LibreCAD/docs/blob/master/appx/calculator.rst
The core of #104 is absolutely correct. It is not obvious to the end user how to use the trigonometric functions. My suggestion is to use the term cos(a)
instead of cos(x)
to clarify that there is an angle expected.
Outside the table we should explain that a
, an angle, can be a pure number, which must be in radians then. Or a number with an appended d
which represents degrees then.
Means sin(1.57079632679)
and sin(90d)
are the same. As for the end user degree is more comfortable I assume that this is the common use case. Of course sin(90*pi/180)
is still possible too, but doesn't make much sense with knowledge of affix d
.
The affix d
makes the reminder of Pi inside the table obsolete I think.
Also Pi is a constant already defined in the calculator, so I suggest a second table with predefined constants. From muparser docs I checked the existence of _pi
and _e
(Euler's number).
pi
without underscore works too, I can't say yet if this is a LibreCAD added constant or also provided by muparser. Fact is that both work, pi
and _pi
.
At least I would remove the muparser link. The muparser version in LibreCAD is not regularly synced and updated, so the references on the muparser page are ahead of LibreCAD and may cause irritations.
Also the muparser sites are mainly dedicated to library implementer and end users may be lost about all the information concerning muparser usage on code level.
sin(90d)
definitely needs documented somewhere, because it doesn't come up anywhere else - rest assured, LC users are not going to be looking into library sources (muparser) to discover what affixes are available.
Why not have constants on the same page, but a separate table? There aren't that many...
The question of whether degrees could be the default , i.e. no affix, and radians be the special case (affix r
), will probably be contentious amongst engineers - and clearly goes beyond 'documentation' - but LC's rotation and dimension tools both use degrees, so this would seem more consistent.
I don't think it hurts to provide muparser link (as it may be helpful for someone), but it maybe needs a warning, and a description of how to discover the version in current/each LC release.