Death Star: Difference between revisions

m
Now can remove axes completely since recent Makie updates
m (Now can remove axes completely since recent Makie updates)
Line 876:
 
=={{header|Julia}}==
<lang julia>using# Makierun in REPL
using Makie
 
function deathstarjpg()
n = 60
θ = [0; (0.5: n - 0.5) / n;= 1]60
φ θ = [0; (0.5: 2nn - 20.5) * 2 / (2n - 1)n; 21]
φ = [(0: 2n - 2) * 2 / (2n - 1); 2]
# if x is +0.9 radius units, replace it with the coordinates of sphere surface at (1.2,0,0) center, radius 0.5 units
x = [(x1 = cospi(φ)*sinpi(θ)) > 0.9 ? 1.2 - x1 * 0.5 : x1 for θ in θ, φ in φ]
# at (1.2,0,0) center, radius 0.5 units
y = [sinpi(φ)*sinpi(θ) for θ in θ, φ in φ]
z x = [(x1 = cospi(φ)*sinpi(θ)) > 0.9 ? 1.2 - x1 * 0.5 : x1 for θ in θ, φ in φ]
x = [(x1 y = cospi[sinpi(φ)*sinpi(θ)) > 0.9 ? 1.2 - x1 * 0.5 : x1 for θ in θ, φ in φ]
y z = [sinpi(φ)*sinpicospi(θ) for θ in θ, φ in φ]
scene = Scene(backgroundcolor=:black)
plt = surface!(scene, x, y, z, color = rand(RGBAf0, 124, 124), show_axis=false)
end
 
deathstarjpg()
plt = surface(x, y, z, color = rand(RGBAf0, 124, 124))
</lang>
 
axis = plt[Axis]
axis[:showgrid] = (false,false,false)
axis[:showaxis] = (false,false,false)
 
Makie.save("deathstar-julia.jpg", plt))</lang>
 
=={{header|LSL}}==
4,107

edits