Death Star: Difference between revisions

m
→‎{{header|Zig}}: enforce const
m (→‎{{header|Wren}}: Changed to Wren S/H)
m (→‎{{header|Zig}}: enforce const)
Line 3,164:
const x = xx - self.cx;
const y = yy - self.cy;
varconst zsq = self.r * self.r - x * x - y * y;
if (zsq >= 0) {
varconst zsqrt = std.math.sqrt(zsq);
return .{ .z1 = self.cz - zsqrt, .z2 = self.cz + zsqrt };
}
Line 3,194:
const amb: T = 0.2;
 
varconst w: usize = @intFromFloat(pos.r * 4);
varconst h: usize = @intFromFloat(pos.r * 3);
var img = try ImageData().init(allocator, "deathStar", w, h);
 
59

edits