Skip to content

Instantly share code, notes, and snippets.

View CodeDrome's full-sized avatar

Chris Webb CodeDrome

View GitHub Profile
@CodeDrome
CodeDrome / estimatingpi1.py
Created April 15, 2024 13:38
estimatingpi.py part 1
import math
PI_STRING = "3.141592653589793238"
RED = "\x1B[31m"
GREEN = "\x1B[32m"
RESET = "\x1B[0m"
def main():
@CodeDrome
CodeDrome / polarplots1.py
Created April 13, 2024 12:47
polarplots.py part 1
import turtle
import math
def main():
print("--------------------")
print("| codedrome.com |")
print("| Polar Plots with |")
print("| Turtle Graphics |")
@CodeDrome
CodeDrome / angledemo.py
Created January 25, 2023 15:04
angledemo.py
import math
import angle
def main():
print("-----------------")
print("| codedrome.com |")
print("| Angles |")
from types import MappingProxyType
import math
class Angle(object):
"""
The Angle class stores an angle value
in a selection of units,
and provides methods for string representation,
@CodeDrome
CodeDrome / functionplotterdemo.py
Created September 13, 2022 13:35
functionplotterdemo.py
import functionplotter as fp
import samplefunctions as sf
def main():
print("--------------------")
print("| codedrome.com |")
print("| Function Plotter |")
print("--------------------\n")
@CodeDrome
CodeDrome / samplefunctions.py
Created September 13, 2022 13:34
samplefunctions.py
samples = {
"quadratic": (lambda x: x**2)
}
@CodeDrome
CodeDrome / functionplotter.py
Created September 13, 2022 13:31
functionplotter.py
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
def plot(functions, start, end, step, config):
"""
@CodeDrome
CodeDrome / halflife.py
Created September 12, 2022 16:25
halflife.py
import halflifeutilities as hlu
import radioactivenuclides as ran
def main():
print("-------------------------------------")
print("| codedrome.com |")
print("| Half Life of Radioactive Nuclides |")
print("-------------------------------------\n")
@CodeDrome
CodeDrome / halflifeutilities.py
Created September 12, 2022 16:20
halflifeutilities.py
import math
import radioactivenuclides as ran
def _sci_not_to_num(significand, exponent):
return significand * 10 ** exponent
@CodeDrome
CodeDrome / radioactivenuclides.py
Created September 12, 2022 16:19
radioactivenuclides.py (truncated - showing 3 of 34)
radioactive_nuclides = {
"tellurium128":
{
"element": "tellurium",
"elementsymbol": "Te",
"atomicmass": 128,
"significand": 2.2,
"exponent": 24
},