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
# by Matias I. Bofarull Oddo - 2022.08.16 | |
# Pisano Cycle: https://oeis.org/A161553 | |
# Pisano Period: https://oeis.org/A001175 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def pisano_cycle_and_period(modulus): |
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
import matplotlib.pyplot as plt | |
plt.rcParams.update({"font.sans-serif": "Consolas"}) | |
num_var = 5 | |
fig = plt.figure(figsize=(9, 9)) | |
for i in range(num_var ** 2): | |
ax = fig.add_subplot(num_var, num_var, i + 1) |
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
# by Matias I. Bofarull Oddo - 2022.05.29 | |
from random import randint | |
import matplotlib.pyplot as plt | |
points = [[randint(0, 999) for _ in range(2)] for _ in range(4)] | |
def linear_interpolation(array, line_ratio): | |
new_X = ((1 - line_ratio) * array[0][0]) + (line_ratio * array[1][0]) |
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
# by Matias I. Bofarull Oddo - 2022.05.03 | |
from math import pi, cos, sin | |
from matplotlib.widgets import Slider | |
import matplotlib.pyplot as plt | |
plt.rcParams["font.sans-serif"] = "Consolas" | |
plt.rcParams["font.weight"] = "bold" | |
plt.rcParams["font.size"] = 10 |
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
# by Matias I. Bofarull Oddo - 2022.05.02 | |
# A small demo of sliders in matplotlib.pyplot | |
from math import pi, cos, sin | |
import matplotlib.pyplot as plt | |
from matplotlib.widgets import Slider | |
phi = (1 + (5 ** (1 / 2))) / 2 - 1 |
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
# by Matias I. Bofarull Oddo - 2022.04.20 | |
# Inspired by Rafael Araujo's post: | |
# https://twitter.com/rafaela31416/status/1509334444976779264?s=20&t=mswbmkrYcJzZC5_5pbir7A | |
import matplotlib.pyplot as plt | |
Φ = (1 + (5 ** (1 / 2))) / 2 | |
X_square = [] |
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
close all; clear; clc; format long g; | |
% Extract submarine cable data from URL and convert to a struct variable | |
fileGeoJSON = webread("https://raw.githubusercontent.com/telegeography/www.submarinecablemap.com/master/web/public/api/v3/cable/cable-geo.json"); | |
cables = jsondecode(fileGeoJSON); | |
% The following forloop parses the struct variable "cables" and 1. counts the | |
% unqiue XY coordinate pair instances (stored in "countPoints"), 2. counts |