Data update

This commit is contained in:
Ingy döt Net 2023-09-16 17:28:03 -07:00
parent 5af6d93694
commit 796d366b97
455 changed files with 7413 additions and 1900 deletions

View file

@ -0,0 +1,20 @@
color 944
linewidth 0.3
on animate
clear
incr = (incr + 0.05) mod 360
x1 = 50
y1 = 50
length = 1
angle = incr
move x1 y1
for i = 1 to 150
x2 = x1 + cos angle * length
y2 = y1 + sin angle * length
line x2 y2
x1 = x2
y1 = y2
length += 1
angle = (angle + incr) mod 360
.
.

View file

@ -0,0 +1,50 @@
const std = @import("std");
const rl = @cImport({
@cInclude("raylib.h");
@cInclude("raymath.h");
});
const SCREEN_WIDTH = 640;
const SCREEN_HEIGHT = 480;
var incr: f32 = 0;
pub fn main() void {
rl.SetConfigFlags(rl.FLAG_WINDOW_RESIZABLE | rl.FLAG_VSYNC_HINT);
rl.SetTargetFPS(60);
rl.InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "Polyspiral");
while (!rl.WindowShouldClose())
updateDrawFrame();
rl.CloseWindow();
}
fn updateDrawFrame() void {
rl.BeginDrawing();
rl.ClearBackground(rl.BLACK);
incr = @mod(incr + 0.001, 360);
drawSpiral(5, std.math.degreesToRadians(f32, incr));
rl.EndDrawing();
}
fn drawSpiral(_length: f32, _angle: f32) void {
const width = rl.GetScreenWidth();
const height = rl.GetScreenHeight();
var point0 = rl.Vector2{ .x = @as(f32, @floatFromInt(width)) / 2, .y = @as(f32, @floatFromInt(height)) / 2 };
var length = _length;
var angle = _angle;
for (0..150) |_| {
const line_vector = rl.Vector2Rotate(rl.Vector2{ .x = length, .y = 0 }, angle);
const point1 = rl.Vector2Add(point0, line_vector);
rl.DrawLineV(point0, point1, rl.LIME);
point0 = point1;
length += 3;
angle += incr;
angle = @mod(angle, comptime @as(f32, (2.0 * std.math.pi)));
}
}