From 9306ac956d92708e0e5086e1eeadb6f4fe4ccc59 Mon Sep 17 00:00:00 2001 From: thad-w541 Date: Sun, 2 Nov 2025 12:19:04 -0600 Subject: [PATCH] init --- README.md | 12 ++++++++++++ pdc | 3 +++ pdc.py | 27 +++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 README.md create mode 100755 pdc create mode 100644 pdc.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..3891186 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Python Desk Calculator + +An easy way to make python a desk calculator + +More features maybe coming soon + +Right now all this does is import the `math` library (`as *`) so that you get `sin`, `cos`, etc. out of the box. Also makes sind, cosd, etc. + +# Install +`git clone ` +`sudo ln -s /path/to/pdc/pdc /usr/bin/pdc` +`sudo chmod +x /usr/bin/pdc` diff --git a/pdc b/pdc new file mode 100755 index 0000000..09b1e95 --- /dev/null +++ b/pdc @@ -0,0 +1,3 @@ +#!/bin/bash + +python3 -i /home/thad/pdc/pdc.py \ No newline at end of file diff --git a/pdc.py b/pdc.py new file mode 100644 index 0000000..bd833f5 --- /dev/null +++ b/pdc.py @@ -0,0 +1,27 @@ +## Math ## + +from math import * + +def sind(x): + return sin(radians(x)) + +def cosd(x): + return cos(radians(x)) + +def tand(x): + return tan(radians(x)) + +def asind(x): + return degrees(asin(x)) + +def acosd(x): + return degrees(acos(x)) + +def atand(x): + return degrees(atan(x)) + +def atan2d(a, b): + return degrees(atan2(a, b)) + +def norm(*args): + return sqrt(sum([float(a)**2 for a in args]))