+2013-02-24 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-ext.el (math-to-radians-2, math-from-radians-2):
+ Add option to force `pi' to remain symbolic.
+ * calc/calcalg2.el (calcFunc-sin, calcFunc-cos, calcFunc-tan)
+ (calcFunc-cot, calcFunc-csc, calcFunc-sec, calcFunc-arcsin)
+ (calcFunc-arccos, calcFunc-arctan): Use symbolic `pi' in the
+ derivatives, when necessary.
+
2013-02-23 Peter Kleiweg <p.c.j.kleiweg@rug.nl>
* progmodes/ps-mode.el (ps-mode-version): Bump to 1.1i.
(math-to-hms a 'rad))
(t a)))
-(defun math-to-radians-2 (a) ; [N N]
+(defun math-to-radians-2 (a &optional force-symbolic) ; [N N]
(cond ((eq (car-safe a) 'hms)
(math-from-hms a 'rad))
((memq calc-angle-mode '(deg hms))
- (if calc-symbolic-mode
+ (if (or calc-symbolic-mode force-symbolic)
(math-div (math-mul a '(var pi var-pi)) 180)
(math-mul a (math-pi-over-180))))
(t a)))
-(defun math-from-radians-2 (a) ; [N N]
+(defun math-from-radians-2 (a &optional force-symbolic) ; [N N]
(cond ((memq calc-angle-mode '(deg hms))
- (if calc-symbolic-mode
+ (if (or calc-symbolic-mode force-symbolic)
(math-div (math-mul 180 a) '(var pi var-pi))
(math-div a (math-pi-over-180))))
(t a)))
(put 'calcFunc-sin\' 'math-derivative-1
(function (lambda (u) (math-to-radians-2 (math-normalize
- (list 'calcFunc-cos u))))))
+ (list 'calcFunc-cos u)) t))))
(put 'calcFunc-cos\' 'math-derivative-1
(function (lambda (u) (math-neg (math-to-radians-2
(math-normalize
- (list 'calcFunc-sin u)))))))
+ (list 'calcFunc-sin u)) t)))))
(put 'calcFunc-tan\' 'math-derivative-1
(function (lambda (u) (math-to-radians-2
(math-sqr
(math-normalize
- (list 'calcFunc-sec u)))))))
+ (list 'calcFunc-sec u))) t))))
(put 'calcFunc-sec\' 'math-derivative-1
(function (lambda (u) (math-to-radians-2
(math-normalize
(list 'calcFunc-sec u))
(math-normalize
- (list 'calcFunc-tan u)))))))
+ (list 'calcFunc-tan u))) t))))
(put 'calcFunc-csc\' 'math-derivative-1
(function (lambda (u) (math-neg
(math-normalize
(list 'calcFunc-csc u))
(math-normalize
- (list 'calcFunc-cot u))))))))
+ (list 'calcFunc-cot u))) t)))))
(put 'calcFunc-cot\' 'math-derivative-1
(function (lambda (u) (math-neg
(math-to-radians-2
(math-sqr
(math-normalize
- (list 'calcFunc-csc u))))))))
+ (list 'calcFunc-csc u))) t)))))
(put 'calcFunc-arcsin\' 'math-derivative-1
(function (lambda (u)
(math-from-radians-2
(math-div 1 (math-normalize
(list 'calcFunc-sqrt
- (math-sub 1 (math-sqr u)))))))))
+ (math-sub 1 (math-sqr u))))) t))))
(put 'calcFunc-arccos\' 'math-derivative-1
(function (lambda (u)
(math-from-radians-2
(math-div -1 (math-normalize
(list 'calcFunc-sqrt
- (math-sub 1 (math-sqr u)))))))))
+ (math-sub 1 (math-sqr u))))) t))))
(put 'calcFunc-arctan\' 'math-derivative-1
(function (lambda (u) (math-from-radians-2
- (math-div 1 (math-add 1 (math-sqr u)))))))
+ (math-div 1 (math-add 1 (math-sqr u))) t))))
(put 'calcFunc-sinh\' 'math-derivative-1
(function (lambda (u) (math-normalize (list 'calcFunc-cosh u)))))