2 ms·
Make a triangle with side lengths 7,8, and 9. Also, one doesnt usually just find a constraint solver to use. You'll want a geometric constraint solver which wi
by phkahler 6y ago
Make a triangle with side lengths 7,8, and 9.
Also, one doesnt usually just find a constraint solver to use. You'll want a geometric constraint solver which will be built on top of a non-linear algebraic constraint solver. It really needs to be integrated into the CAD system.
- OJFord 6y ago> Make a triangle with side lengths 7,8, and 9. p, q, r = params("side1", "side2", "side3") pq = arccos((p^2+q^2-r^2)/(2*p*q)) pr = # ... similar qr = # ... similar assert pq + pr + qr == 360, "Side lengths invalid" pside = line((0,0), (p,0)) xy_qr = (r*cos(180-pr), r*sin(180-pr)) qside = line((p,0), xy_qr) rside = line(xy_qr, (0,0)) triangle = sketch(pside, qside, rside) Or whatever this fictional API is to look like. Obviously to do generic constraint solving, you need a generic constraint solver. My point is that if you have fixed known constraints, and a programming language, you can just compute what you want explicitly.