commit 978dfa3124014dfe6d5924e65f5ef43eef9ac322
parent 3076e7710dbbd6c681d8bfc6403719079509d71e
Author: Christos Margiolis <christos@margiolis.net>
Date: Sat, 7 Mar 2020 08:13:37 +0200
added screenshot
Diffstat:
5 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
@@ -30,7 +30,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
run:
- ./$(BIN_DIR)/$(TARGET) ${y}
+ ./$(BIN_DIR)/$(TARGET)
clean:
$(RM) $(OBJ) $(BIN_DIR)/$(TARGET)
diff --git a/README.md b/README.md
@@ -3,6 +3,8 @@
**UNDER CONSTRUCTION**
A simple ncurses graph generator.
+![Screenshot](https://user-images.githubusercontent.com/54286563/76137975-82b5fd00-604b-11ea-8c34-f1adc98c0224.png)
+
## Dependencies
* `ncurses`
@@ -17,3 +19,4 @@ A simple ncurses graph generator.
* Add the option to give a function while in the program
* Add coordinates using cursor pointing
* *(Perhaps)* add derivative calculator
+* Display expression
diff --git a/bin/graphcurses b/bin/graphcurses
Binary files differ.
diff --git a/obj/main.o b/obj/main.o
Binary files differ.
diff --git a/src/main.cpp b/src/main.cpp
@@ -42,8 +42,8 @@ void getstep(Plane &plane, float &xstep, float &ystep)
{
int ymax, xmax;
getmaxyx(stdscr, ymax, xmax);
- if (xstep) xstep = (plane.xmax - plane.xmin) / (xmax + 1);
- if (ystep) ystep = (plane.ymax - plane.ymin) / (ymax + 1);
+ if (xstep) xstep = (plane.xmax - plane.xmin) / (xmax + 1.0f);
+ if (ystep) ystep = (plane.ymax - plane.ymin) / (ymax + 1.0f);
}
void draw_axes(Plane &plane)