Engine prototype #13
@ -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)
|
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 ===
|
# === Gram matrix realization ===
|
||||||
|
|
||||||
# the Lorentz form
|
# the Lorentz form
|
||||||
|
Loading…
Reference in New Issue
Block a user