summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2025-10-22 21:45:14 +0200
committerJesper Jensen <jesper@jnsn.dev>2025-10-22 21:45:14 +0200
commit5d8760a22fb5076a6f41fbcba978ff9a03056da4 (patch)
treed3a040a6a378c9298cb8487fa47a5e1d6b76e4a2 /src
parent9b33e6879b79905adfa415eba911d7e8b540429f (diff)
More tests
Diffstat (limited to 'src')
-rw-r--r--src/construction.c7
-rw-r--r--src/main.c21
2 files changed, 15 insertions, 13 deletions
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);