init
This commit is contained in:
12
README.md
Normal file
12
README.md
Normal file
@@ -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 <this repo>`
|
||||
`sudo ln -s /path/to/pdc/pdc /usr/bin/pdc`
|
||||
`sudo chmod +x /usr/bin/pdc`
|
||||
27
pdc.py
Normal file
27
pdc.py
Normal file
@@ -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]))
|
||||
Reference in New Issue
Block a user