about summary refs log tree commit diff stats
path: root/free-fall.lsp
diff options
context:
space:
mode:
authorDarren Bane <darren.bane@emdalo.com>2020-05-27 00:30:29 +0100
committerDarren Bane <darren.bane@emdalo.com>2020-05-27 00:30:29 +0100
commitb8168bbb7ae6063fa802386926ef13126ba11ab7 (patch)
tree652c6b79c6d9a227f0f53f3811d3ae4d861f8e2b /free-fall.lsp
parent01b139cac8273892b4b66057f9da67e9f58d8c39 (diff)
downloadlsp-b8168bbb7ae6063fa802386926ef13126ba11ab7.tar.gz
A bit more doc details.
Diffstat (limited to 'free-fall.lsp')
-rw-r--r--free-fall.lsp6
1 files changed, 3 insertions, 3 deletions
diff --git a/free-fall.lsp b/free-fall.lsp
index 27dec85..a7cd918 100644
--- a/free-fall.lsp
+++ b/free-fall.lsp
@@ -1,10 +1,10 @@
 ;; TODO: air resistance, terminal velocity
-(defconstant +G+ 9.81)
+(defconstant +g+ 9.81)
 (defglobal *alt* 20000)
 (defglobal *v* 0)
 (defun step ()
    (setq *alt* (- *alt* *v*))
-   (setq *v* (+ *v* +G+))
+   (setq *v* (+ *v* +g+))
    (format (standard-output) "~A~%" *alt*))
 (defun my-main ()
    (while (> *alt* 0)
@@ -15,5 +15,5 @@
    (format (standard-output) "Gravitational constant: ~A~%" +G+)
    (format (standard-output) "Twice that: ~A~%" (* 2 +G+))
    (let* ((time 10)
-          (distance (* 0.5 +G+ (expt time 2))))
+          (distance (* 0.5 +g+ (expt time 2))))
          (format (standard-output) "Distance travelled in 10 seconds of free fall: ~A~%" distance)))