Latest Results
Bugfix: symmetric constraint used wrong residual (#140)
My previous PRs #139, #138 used an incorrect residual function for the
constraint, so that this solution, which clearly isn't symmetric, was
chosen:
```markdown
# constraints
point p
point q
line(p, q)
point a
point b
p = (0, 0)
q = (2, 2)
a = (0.5, 0.4)
symmetric(p, q, a, b)
# guesses
p roughly (0.1, 0.1)
q roughly (2.1, 2)
a roughly (0, 1.9)
b roughly (1.9, 0)
```
<img width="600" height="600" alt="foo (1)"
src="https://github.com/user-attachments/assets/f8f9a40e-abe9-43ce-8e36-856f35431155"
/>
Now it works properly though.
<img width="600" height="600" alt="fixed"
src="https://github.com/user-attachments/assets/e99af6ea-d109-43cd-a659-14e9e973d809"
/>
See the math in the [updated
notebook](https://colab.research.google.com/drive/17L_Lq-yTJOaLhDd2R0OtEe4Rwkr5RHsj#scrollTo=HpAraZ0OhKBW).
Thanks to Sympy outputting Rust code directly, this residual took only
20 minutes to work through completely, with all its partial derivatives
put into Rust code and a unit test! Active Branches
#790%
© 2025 CodSpeed Technology