Closed lordofbikes closed 4 months ago
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.
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 ofcos(x)
to clarify that there is an angle expected. Outside the table we should explain thata
, an angle, can be a pure number, which must be in radians then. Or a number with an appendedd
which represents degrees then. Meanssin(1.57079632679)
andsin(90d)
are the same. As for the end user degree is more comfortable I assume that this is the common use case. Of coursesin(90*pi/180)
is still possible too, but doesn't make much sense with knowledge of affixd
.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.