From 5d8760a22fb5076a6f41fbcba978ff9a03056da4 Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Wed, 22 Oct 2025 21:45:14 +0200 Subject: More tests --- src/construction.c | 7 ++++--- src/main.c | 21 +++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/construction.c b/src/construction.c index 4ef38de..918ceef 100644 --- a/src/construction.c +++ b/src/construction.c @@ -126,8 +126,8 @@ void execute_drawing(struct drawing *drawing, double inputs[]) { if(current->arg1->circle.radius == 0 && current->arg2->circle.radius == 0) { // The tangent is just a line through the two centers - // @FAST: This is wasteful. If the the procedure too the - // two vectors directly, we wouldn't have to copy here. + // @FAST: This is wasteful. If the procedure took the two + // vectors directly, we wouldn't have to copy here. struct point p1; glm_vec2_copy(current->arg1->circle.center, p1.pos); struct point p2; @@ -156,7 +156,8 @@ void execute_drawing(struct drawing *drawing, double inputs[]) { }break; case CMD_POINT_CIRCLE_CIRCLE: { assert(current->result.type == ETYPE_POINT); - vec2 between_centers; glm_vec2_sub(current->arg1->circle.center, current->arg2->circle.center, between_centers); + vec2 between_centers; + glm_vec2_sub(current->arg1->circle.center, current->arg2->circle.center, between_centers); glm_vec2_mul(between_centers, (vec2){2, 2}, between_centers); double a = between_centers[0]; double b = between_centers[1]; diff --git a/src/main.c b/src/main.c index 5efc094..908c15a 100644 --- a/src/main.c +++ b/src/main.c @@ -1141,13 +1141,13 @@ int main(int argc, char *argv[]) { }, { .type = CT_POINT_POINT_DISTANCE, - .v = 10, + .v = 7, .c1 = &components[1], .c2 = &components[2], }, { .type = CT_POINT_POINT_DISTANCE, - .v = 10, + .v = 7, .c1 = &components[2], .c2 = &components[0], }, @@ -1360,8 +1360,8 @@ int main(int argc, char *argv[]) { { .type = CT_LINE_LINE_ANGLE, .v = M_PI/2, - .c1 = &box.side[3], - .c2 = &box.side[0], + .c1 = &box.side[0], + .c2 = &box.side[3], }, { .type = CT_LINE_LINE_ANGLE, @@ -1371,9 +1371,9 @@ int main(int argc, char *argv[]) { }, { .type = CT_LINE_LINE_ANGLE, - .v = M_PI/2, - .c1 = &box.side[2], - .c2 = &box.side[3], + .v = M_PI/2.9, + .c1 = &box.side[3], + .c2 = &box.side[2], }, { .type = CT_LINE_LINE_ANGLE, @@ -1384,14 +1384,14 @@ int main(int argc, char *argv[]) { { .type = CT_POINT_POINT_DISTANCE, - .v = 10, - .c1 = &line.corner_start, + .v = 9.5, + .c1 = &line.corner_end, .c2 = &box.corner[0], }, { .type = CT_POINT_POINT_DISTANCE, .v = 10, - .c1 = &line.corner_end, + .c1 = &line.corner_start, .c2 = &box.corner[0], }, @@ -1449,6 +1449,7 @@ int main(int argc, char *argv[]) { if(drawing.error != NULL) { plot_generic(*drawing.error->arg1); plot_generic(*drawing.error->arg2); + fprintf(stderr, "Solver error detected. Drawing will be incomplete\n"); } // plot_line_between(components[0].e->point, components[1].e->point); -- cgit v1.2.3