Skip to content

Commit ecc3970

Browse files
Chessing234claude
andauthored
Fix sign consistency in Newton method 2D code (#157)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bbcbde0 commit ecc3970

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/images_abstractions/newton_method.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ function newton2D_step(T, x)
290290

291291
J = ForwardDiff.jacobian(T, x) # should use StaticVectors
292292

293-
δ = J \ T(x) # J^(-1) * T(x)
294-
295-
return x - δ
293+
δ = J \ -T(x) # J^(-1) * (-T(x))
294+
295+
return x + δ
296296
end
297297

298298
# ╔═╡ 923bde64-7ba4-11eb-21e9-a11993aaab2e

0 commit comments

Comments
 (0)