Engine prototype #13

Merged
glen merged 133 commits from engine-proto into main 2024-10-21 03:18:48 +00:00
2 changed files with 10 additions and 12 deletions
Showing only changes of commit e41bcc7e13 - Show all commits

View File

@ -197,7 +197,8 @@ function realize(ctx::Construction{T}) where T
push!(eqns, sum(elt.vec[2] for elt in Iterators.flatten((ctx.points, ctx.spheres))) - n_elts)
end
(Generic.Ideal(coordring, eqns), eqns)
## [test] (Generic.Ideal(coordring, eqns), eqns)
(nothing, eqns)
end
end

View File

@ -61,21 +61,18 @@ CoeffType = Rational{Int64}
##freedom = Engine.dimension(ideal_tan_sph)
##println("Three mutually tangent spheres: $freedom degrees of freedom")
p = Engine.Point{CoeffType}()
q = Engine.Point{CoeffType}()
a = Engine.Sphere{CoeffType}()
b = Engine.Sphere{CoeffType}()
p_on_a = Engine.LiesOn{CoeffType}(p, a)
p_on_b = Engine.LiesOn{CoeffType}(p, b)
q_on_a = Engine.LiesOn{CoeffType}(q, a)
q_on_b = Engine.LiesOn{CoeffType}(q, b)
points = [Engine.Point{CoeffType}() for _ in 1:3]
spheres = [Engine.Sphere{CoeffType}() for _ in 1:2]
ctx_joined = Engine.Construction{CoeffType}(
elements = Set([p, q, a, b]),
relations= Set([p_on_a, p_on_b, q_on_a, q_on_b])
elements = Set([points; spheres]),
relations= Set([
Engine.LiesOn{CoeffType}(pt, sph)
for pt in points for sph in spheres
])
)
ideal_joined, eqns_joined = Engine.realize(ctx_joined)
freedom = Engine.dimension(ideal_joined)
println("Two points on two spheres: $freedom degrees of freedom")
println("$(length(points)) points on $(length(spheres)) spheres: $freedom degrees of freedom")
# --- test rational cut ---