Skip to content

Instantly share code, notes, and snippets.

View EduardoJM's full-sized avatar
🏠
Working from home

Eduardo Oliveira EduardoJM

🏠
Working from home
View GitHub Profile
@EduardoJM
EduardoJM / sat_2.js
Created July 11, 2020 17:57
Separating Axis Theorem Polygon Structure
function createPolygon(vertices) {
const polygon = {};
polygon.vertices = vertices;
polygon.edges = buildEdges(vertices);
polygon.projectInAxis = function(x, y) {
}
polygon.testWith = function (otherPolygon) {
}
@EduardoJM
EduardoJM / sat_1.js
Created July 11, 2020 17:55
Separating Axis Theorem Helper Functions
function buildEdges(vertices) {
const edges = [];
if (vertices.length < 3) {
console.error("Only polygons supported.");
return edges;
}
for (let i = 0; i < vertices.length; i++) {
const a = vertices[i];
let b = vertices[0];
if (i + 1 < vertices.length) {
@EduardoJM
EduardoJM / funcoes_admissiveis.tex
Created October 23, 2019 19:41
Código LaTeX usando pacotes tikz plotando gráfico com funções admissiveis
%
% Código LaTeX usando pacotes tikz plotando gráfico com funções admissiveis
% Por Eduardo Oliveira (https://eduardojm.github.io)
%
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tkz-fct}
\begin{document}