Death Star: Difference between revisions

m
Line 881:
θ = [0; (0.5: n - 0.5) / n; 1]
φ = [(0: 2n - 2) * 2 / (2n - 1); 2]
x = [(x1 = cospi(φ)*sinpi(θ)) > 0.9 ? 1.62 - x1 * 0.5 : x1 for θ in θ, φ in φ]
# x modified to approximate effect of a subtracted sphere of radius 0.8
x = [(x1 = cospi(φ)*sinpi(θ)) > 0.9 ? 1.6 - x1 : x1 for θ in θ, φ in φ]
y = [sinpi(φ)*sinpi(θ) for θ in θ, φ in φ]
z = [cospi(θ) for θ in θ, φ in φ]
 
plt = surface(x, y, z, color = rand(RGBAf0, 124, 124)) # random color pattern on sphere
 
axis = plt[Axis]
Line 892 ⟶ 891:
axis[:showaxis] = (false,false,false)
 
Makie.save("deathstar-julia.jpg", plt))</lang>
 
=={{header|LSL}}==
4,105

edits