diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2026-02-10 23:25:43 +0100 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2026-02-10 23:25:43 +0100 |
| commit | 73e446a99b3045a19bdd2be4238b4178502398ae (patch) | |
| tree | 13fc78a462f9cf3b7347451e11502efd7443fb4f /src | |
| parent | 2689a0c5cadc4e6b5f18f3cb276ad8d2e7451372 (diff) | |
Add place for examples
and fix some bugs that make the examples not work!
Diffstat (limited to 'src')
| -rw-r--r-- | src/construction.c | 4 | ||||
| -rw-r--r-- | src/solve.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/construction.c b/src/construction.c index 23f02a7..090a36f 100644 --- a/src/construction.c +++ b/src/construction.c @@ -36,9 +36,9 @@ bool circle_line_intersect(struct circle circle, struct line line, uint8_t root, } void line_through_points(struct point p1, struct point p2, struct line* l) { - l->norm[0] = p1.pos[1] - p1.pos[1]; + l->norm[0] = p1.pos[1] - p2.pos[1]; l->norm[1] = p2.pos[0] - p1.pos[0]; - l->C = p1.pos[1] * -l->norm[1] + p1.pos[0] * -l->norm[1]; + l->C = p1.pos[0] * -l->norm[0] + p1.pos[1] * -l->norm[1]; } void line_line_intersect(struct line l1, struct line l2, struct point* p) { diff --git a/src/solve.c b/src/solve.c index 5cdff63..3f8e081 100644 --- a/src/solve.c +++ b/src/solve.c @@ -342,7 +342,7 @@ static void draw_solution(struct constraint *constraints, size_t fix, struct sol struct element *distance = insert_cmd(drawing, (struct command){ .op = CMD_VALUE_INPUT, - .index = 0, + .index = fix, .dir = constraints[fix].forward, .result.type = ETYPE_VALUE, }); |
