10-06-2015, 07:11 PM
Post: #54
 Han Senior Member Posts: 1,882 Joined: Dec 2013
(10-06-2015 02:54 AM)Claudio L. Wrote:
(10-05-2015 02:05 PM)Han Wrote:  Sometimes less is more. I find that after some point, having too many commands becomes cumbersome. We have units, including ° should we want degrees. The trig functions should always assume radians (in my opinion) or at the very most depend on the angle mode. Users who wish to explicitly use an angle measure that is invariant under angle mode should specify the units. A custom key can be set up to quickly add the appropriate units. In programs, the explicit unit only needs to be appended once as subsequent operations would inherit the initial unit.

Well, SIN will only accept radians, but if there's units, it has to use the units given. In that aspect your proposal is identical to mine. Mine just builds on top of that, adding the SIND and SING commands.
The problem with using units alone, is how to specify the units for the inverse functions.
ASIN(1) = ???
We'd have to provide a second argument with the units, and those functions have traditionally needed one argument. Or, we are back to square one, with a system-wide flag.

(10-05-2015 02:05 PM)Han Wrote:  EDIT: My proposal also does away with the derivative issue; e.g. the derivative of SIN(X) will always be COS(X) since the trig functions should presumably know how to auto-adjust for inputs that are properly tagged with units of angle measure (and assume radians otherwise).

I'm not so sure that's right.
If you use degrees, for example, SIN(r) = SIN(pi/180*x), and it's derivative is pi/180*COS(pi/180*x) = pi/180* COS(r), so you need that constant if you provide 'r' with a units of degree.
In a CAS expression, you don't know the units of r until you evaluate it, so you can't "fix" the derivative based on that. That's why the 50g CAS forces radians mode, but using SIND the parser knows all the time that the argument will come in degrees, and can produce the correct output.

BTW: I updated the ROM image with the bugs described by Helix fixed, and I also added the UFACT command.

You are quite right; I had not thought it through carefully.

Graph 3D | QPI | SolveSys
 « Next Oldest | Next Newest »