Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
import numpy as np | |
uppers = "QWERTYUIOPASDFGHJKLZXCVBNM" | |
lowers = "qwertyuiopasdfghjklzxcvbnm" | |
digits = list(map(str, range(10))) | |
specials = "!@#$%&*()+-/" | |
# specials = "!+-()#" | |
# specials = "" | |
chars = set(uppers) |
This file contains 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
def comb(a: int, b: int) -> int: | |
""" | |
Implements the binomial coefficient: | |
( a ) a ! | |
( ) = ------------- | |
( b ) b! * (a-b)! | |
""" | |
prod = 1 | |
for i in range(min(b, a-b)): | |
prod *= a-i |
This file contains 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
import numpy as np | |
from matplotlib import pyplot as plt | |
nelips = 3 | |
ndim = 2 | |
all_axis = [] | |
for i in range(nelips): | |
matrix = np.random.rand(ndim, ndim) | |
matrix += np.transpose(matrix) | |
eigvals, eigvecs = np.linalg.eigh(matrix) |
This file contains 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
from __future__ import annotations | |
from typing import * | |
import numpy as np | |
from matplotlib import pyplot as plt | |
class Point2D: | |
def __init__(self, x: float, y: float): |
This file contains 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
# import matplotlib | |
# matplotlib.use('webagg') | |
import math | |
from typing import Tuple, Union | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib.lines import Line2D |
This file contains 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
import numpy as np | |
from matplotlib import pyplot as plt | |
from typing import Tuple | |
class Conic: | |
def __init__(self, coefs: Tuple[float]): | |
self.coefs = coefs |
This file contains 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
from typing import Tuple | |
import numpy as np | |
from fractions import Fraction | |
import math | |
def invert_integer_matrix( | |
matrix: Tuple[Tuple[int]], | |
) -> Tuple[Tuple[int], Tuple[Tuple[int]]]: | |
""" |
This file contains 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
from typing import Tuple | |
import sympy as sp | |
import numpy as np | |
def Bezier2Canonical(degree: int) -> np.ndarray: | |
""" | |
Returns a transformation matrix between the basis | |
Bezier -> Canonical | |
""" | |
matrix = np.zeros((degree+1, degree+1), dtype="object") |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder