Browse Source

Added actual trig functions

Samuel W. Flint 8 years ago
parent
commit
2668ff4399
1 changed files with 19 additions and 1 deletions
  1. 19 1
      derive.lisp

+ 19 - 1
derive.lisp

@@ -4,7 +4,10 @@
 
 (defpackage #:derive
   (:use #:cl)
-  (:export :derive))
+  (:export :derive
+           :csc
+           :sec
+           :cot))
 
 (in-package #:derive)
 
@@ -84,4 +87,19 @@ Apply the Power Rule"
         `(* ,power (expt ,(derive equation) ,(1- power)))
         `(* ,power (expt ,equation ,(1- power))))))
 
+(defun csc (x)
+  "csc -- (csc x)
+Calculate the cosecant of x"
+  (/ (sin x)))
+
+(defun sec (x)
+  "sec -- (sec x)
+Calculate the secant of x"
+  (/ (cos x)))
+
+(defun cot (x)
+  "cot -- (cot x)
+Calculate the cotangent of x"
+  (/ (tan x)))
+
 ;;; End derive