This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# plot of u/ShinyGrezz's thing on r/math | |
# http://sambrunacini.com | |
import pyperclip | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from desmos_list_convert import to_desmos_table | |
# desmos_list_convert is at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert python data to desmos tables/lists | |
# http://sambrunacini.com | |
def to_desmos_list(iterable): | |
""" convert a python list of numbers or points into a string that can be pasted into desmos """ | |
iterable = list(iterable) | |
string = ",".join([r"("+fix_point(element)+r")" for element in iterable]) | |
return r"\left[" + string.replace(r"(",r"\left(").replace(r")",r"\right)") + r"\right]" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// Calc will be defined when on desmos. | |
let expressions = Calc.getExpressions(); | |
if (expressions.length == 1 && expressions[0].latex == "") { | |
Calc.removeExpressions(expressions); // this deletes the first expression, because it will already be loaded with the old colors | |
} | |
Calc.updateSettings({"colors": { | |
"RED": "#ff0000", | |
"GREEN": "#00ff00", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I am ashamed for writing this. | |
import inspect; | |
class Cin: | |
""" time to whip out some python magic """ | |
def __rshift__(self, other): | |
# I don't want to require that "other" is declared global. | |
cin = input(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Fluid particles travelling through a vector field | |
By Sam Brunacini | |
Posts at http://sambrunacini.com/blog/ | |
""" | |
import pygame; | |
import math; | |
from math import hypot, atan2, sin, cos, pi; |