Start "circles in triangle" from a very close guess

This commit is contained in:
Aaron Fenyes 2024-07-08 14:21:10 -07:00
parent 610fc451f0
commit 023759a267

View File

@ -31,6 +31,11 @@ end
append!(J, [6, 4, 6, 5, 7, 5, 7, 3, 8, 3, 8, 4])
append!(K, [4, 6, 5, 6, 5, 7, 3, 7, 3, 8, 4, 8])
append!(values, fill(-1, 12))
#= make construction rigid
append!(J, [3, 4, 4, 5])
append!(K, [4, 3, 5, 4])
append!(values, fill(-0.5, 4))
=#
gram = sparse(J, K, values)
# set initial guess (random)
@ -42,6 +47,7 @@ gram = sparse(J, K, values)
## guess = Engine.rand_on_shell(fill(BigFloat(-1), 8))
# set initial guess
#=
guess = hcat(
Engine.plane(BigFloat[0, 0, 1], BigFloat(0)),
Engine.sphere(BigFloat[0, 0, 0], BigFloat(1//2)),
@ -52,6 +58,17 @@ guess = hcat(
Engine.sphere(BigFloat[cos(-pi/3), sin(-pi/3), 0], BigFloat(1//5)),
Engine.sphere(BigFloat[cos(pi/3), sin(pi/3), 0], BigFloat(1//5))
)
=#
guess = hcat(
Engine.plane(BigFloat[0, 0, 1], BigFloat(0)),
Engine.sphere(BigFloat[0, 0, 0], BigFloat(0.9)),
Engine.plane(BigFloat[1, 0, 0], BigFloat(1)),
Engine.plane(BigFloat[cos(2pi/3), sin(2pi/3), 0], BigFloat(1)),
Engine.plane(BigFloat[cos(-2pi/3), sin(-2pi/3), 0], BigFloat(1)),
Engine.sphere(4//3*BigFloat[-1, 0, 0], BigFloat(1//3)),
Engine.sphere(4//3*BigFloat[cos(-pi/3), sin(-pi/3), 0], BigFloat(1//3)),
Engine.sphere(4//3*BigFloat[cos(pi/3), sin(pi/3), 0], BigFloat(1//3))
)
# complete the gram matrix using gradient descent
L, history = Engine.realize_gram(gram, guess, max_descent_steps = 200)