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 createPolygon(vertices) { | |
| const polygon = {}; | |
| polygon.vertices = vertices; | |
| polygon.edges = buildEdges(vertices); | |
| polygon.projectInAxis = function(x, y) { | |
| } | |
| polygon.testWith = function (otherPolygon) { | |
| } |
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 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) { |
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
| % | |
| % 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} |
NewerOlder