Polar Coordinate - Archimedean spiral
How do I make an polar coordinate - archimedean spiral?
What is a polar coordinate - archimedean spiral? How do you make a polar coordinate - archimedean spiral? This script and codes were developed by JasonPark on 01 January 2023, Sunday.
Polar Coordinate - Archimedean spiral - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Polar Coordinate - Archimedean spiral</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <svg id="board" width=500 height=500>
</svg> <script src="js/index.js"></script>
</body>
</html>
Polar Coordinate - Archimedean spiral - Script Codes CSS Codes
#board { border:1px solid black;
}
Polar Coordinate - Archimedean spiral - Script Codes JS Codes
const board = document.getElementById('board');
const width = 500;
const height = 500;
function decimalToColorHexString(number){ number %= 16777216; let table = [ '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' ]; let q = number; let st = [] while( q > 0 ){ let r = q % 16; q = ~~(q / 16); st.push(r); } let residual = 6 - st.length; for(let i = 0 ; i < residual; i++){ st.push(0); } st.reverse(); return st.map((elem) => (table[elem])).reduce((x, y) => (x + y), '');
}
function drawCurve(scale, limit, dt, colorScale){ let color = 1 let colorAccel = 1 for(let theta = 0; theta < limit; theta += dt){ if (scale / dt > 10000) { return; } let y =scale*theta*Math.sin(theta); let x =scale*theta*Math.cos(theta); let c = document.createElementNS("http://www.w3.org/2000/svg", "circle"); let colorCode = '#'+ decimalToColorHexString(color); c.setAttribute('cx', x + width/2); c.setAttribute('cy', y + height/2); c.setAttribute('r' , 1); c.setAttribute('fill', colorCode); board.appendChild(c); color += colorScale*(colorAccel + 1) ; colorAccel += 1; }
}
drawCurve(12.5, 20, 0.05, 5);
Developer | JasonPark |
Username | wooljs |
Uploaded | January 01, 2023 |
Rating | 3 |
Size | 2,114 Kb |
Views | 16,192 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Tic Tac Toe Game with React and Redux | 2,267 Kb |
Digital Calculator | 2,547 Kb |
Guidepopup | 3,747 Kb |
Appointment DatetimePicker | 4,301 Kb |
Search popup | 2,475 Kb |
A Pen by JasonPark | 3,087 Kb |
Lookbook module | 4,403 Kb |
YxT | 4,421 Kb |
Polar Coordinate - Rose shape | 2,113 Kb |
Counter Example 001 | 2,283 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
The Rope | Chribbe | 2,886 Kb |
CSS-Flexbox-Demo | Sstiglets | 1,709 Kb |
A Pen by Dalton Liu | Liudalton | 12,437 Kb |
Two column of responsive height | Fixie | 2,908 Kb |
Count up | Alanshortis | 2,391 Kb |
Reading Grid | Tappily | 4,306 Kb |
CSS Link Zoom On Click | Bryce | 1,960 Kb |
Materializecss input form | Jasonchan | 1,443 Kb |
Subscription Newsletter - Before inlining | Bradstrong | 7,526 Kb |
Foundation 5 Menu - Accessibility | Xporter | 1,999 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!