Lorenz Attractor
How do I make an lorenz attractor?
A simple Lorenz Attractor renderer. Change the parameters for different results!. What is a lorenz attractor? How do you make a lorenz attractor? This script and codes were developed by Liabru on 31 August 2022, Wednesday.
Lorenz Attractor - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Lorenz Attractor</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- A simple Lorenz Attractor renderer by @liabru
-->
<canvas id="canvas" width="500" height="660"> <script src="js/index.js"></script>
</body>
</html>
Lorenz Attractor - Script Codes CSS Codes
body { background: #18181d; text-align: center;
}
canvas { display: inline-block; max-width: 100%; max-height: 100%;
}
Lorenz Attractor - Script Codes JS Codes
// A simple Lorenz Attractor renderer
// Change the parameters for different results!
// by @liabru - http://brm.io
var canvas = document.getElementById('canvas'), context = canvas.getContext('2d'), c = 28, h = 0.015, t = -6, x0 = 0, y0 = 1, z0 = 10, x1, y1, z1, cx = 250, cy = 330, scale = 15, n = 20000, i = 0;
var interval = setInterval(function() { if (i < n) { for (var k = 0; k < 20; k += 1) { x1 = x0 + h * t * (x0 - y0); y1 = y0 + h * (-x0 * z0 + c * x0 - y0); z1 = z0 + h * (x0 * y0 - z0); context.strokeStyle = "hsl(" + Math.abs(x1)*10 + "," + Math.abs(y1)*10 + "%," + Math.abs(z1)*2 + "%)"; context.beginPath(); context.moveTo(cx + x0 * scale, cy + y0 * scale); context.lineTo(cx + x1 * scale, cy + y1 * scale); context.stroke(); x0 = x1; y0 = y1; z0 = z1; i += 1; } } else { clearInterval(interval); }
}, 1);
Developer | Liabru |
Username | liabru |
Uploaded | August 31, 2022 |
Rating | 3.5 |
Size | 2,107 Kb |
Views | 129,536 |
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 |
Wrecking Ball Physics | 2,798 Kb |
Slingshot Game | 3,065 Kb |
Bridge Physics | 2,889 Kb |
Catapult | 2,784 Kb |
Gears | 3,030 Kb |
Ragdoll | 4,347 Kb |
Cars | 2,759 Kb |
Avalanche | 2,924 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 |
Scroll effect with text with help from Skrollr | Luxonglassing | 2,935 Kb |
Ripples in water | Nobitagit | 2,704 Kb |
Fun animations with CSS3 | Minimalmonkey | 2,360 Kb |
CSSOff 2013 Submission | Codewunder | 14,766 Kb |
Freecodecamp - Tribute Page | Samoht513 | 3,583 Kb |
Mosaic transition effect between two photos using jQuery | Stathisg | 2,518 Kb |
Svg sky | Omodev | 7,070 Kb |
Dribbble Template | ExtremelyGinger | 2,204 Kb |
Chuck Norris Background | Manz | 1,967 Kb |
A simple log in form made with css | Mayurelbhar | 2,160 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!