Engine prototype #13

Open
Vectornaut wants to merge 117 commits from engine-proto into main
Showing only changes of commit 828498b3de - Show all commits

View File

@ -33,6 +33,19 @@ rand_on_shell(rng::AbstractRNG, shells::Array{T}) where T <: Number =
rand_on_shell(shells::Array{<:Number}) = rand_on_shell(Random.default_rng(), shells)
# === elements ===
plane(normal, offset) = [normal; offset; offset]
function sphere(center, radius)
dist_sq = dot(center, center)
return [
center / radius;
0.5 * ((dist_sq - 1) / radius - radius);
0.5 * ((dist_sq + 1) / radius - radius)
]
end
# === Gram matrix realization ===
# the Lorentz form