Skip to content

Commit

Permalink
moved
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-sapletta-com committed Nov 26, 2023
1 parent bda3e28 commit 7938a4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hexagon.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ document.addEventListener('DOMContentLoaded', function() {
function getHexagonPoints(edgeLength) {
// Oblicz wysokość sześciokąta
const height = Math.sqrt(3) * edgeLength;
const width = Math.sqrt(3) * edgeLength;
const centerY = height / 2 + edgeLength / 2;
const centerX = width / 2 + edgeLength / 2;

// Oblicz współrzędne wierzchołków
const points = [
//{ x: edgeLength / 2, y: centerY }, // lewy górny wierzchołek
{ x: edgeLength / 2, y: centerY }, // lewy górny wierzchołek
{ x: 0, y: centerY - height / 2 }, // górny lewy
{ x: edgeLength, y: centerY - height / 2 }, // górny prawy
{ x: edgeLength * 1.5, y: centerY }, // prawy górny wierzchołek
{ x: edgeLength, y: centerY + height / 2 }, // dolny prawy
{ x: 0, y: centerY + height / 2 }, // dolny lewy
{ x: edgeLength, y: centerY + height / 2 }, // dolny lewy
//{ x: 0, y: centerY + height / 2 }, // dolny lewy
];

// Połącz współrzędne w string dla atrybutu 'points' w SVG
Expand Down

0 comments on commit 7938a4d

Please sign in to comment.