From f47ce237f6f1d8c1d7c840363ac15c755600d93e Mon Sep 17 00:00:00 2001 From: Rosyid Haryadi Date: Sat, 23 Dec 2023 02:50:40 +0700 Subject: fix y mirrored --- src/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 17edaa7..e35e325 100644 --- a/src/main.c +++ b/src/main.c @@ -58,10 +58,9 @@ void doDrawing(InitConfig config) { int end = config.SCREEN_WIDTH / 2; int start = -1 * end; for (int x = start; x < end; x++) { - float y1 = 100 * sinf((float)x/10); - float y2 = 100 * cosf((float)x/12); - float y = y1 + y2; - DrawPixelV(Vector2Add((Vector2){(float)x, y}, (Vector2){(float)config.ORIGIN_X, (float)config.ORIGIN_Y}), WHITE); + float y = 100 * sinf((float)x/10); + y *= -1; + DrawPixelV(Vector2Add((Vector2){(float)x, y}, (Vector2){(float)config.ORIGIN_X, (float)config.ORIGIN_Y}), GREEN); } EndDrawing(); -- cgit v1.2.3-70-g09d2