Skip to content

Commit

Permalink
do cosgraph example
Browse files Browse the repository at this point in the history
  • Loading branch information
heliumhydride committed Dec 2, 2024
1 parent 810a904 commit 8246d15
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
make a README.md
fix mkline segfaults
fix mkpixel x y orientation
cosgraph example
snake game example
complex_rotation example (use complex numbers to rotate points on a graph around the origin)
9 changes: 1 addition & 8 deletions examples/cosgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,8 @@ int main(void) {

printf("\033[s"); // save cursor position

// TODO for every x from 0 to 'cols', graph the cos(x)

/*
add_pixel(pixelmap, 0,1,1.0f);
render_pixelmap(pixelmap);
*/

for(int x = 0; x < cols; x++) {
add_pixel(pixelmap, (int)rows/2, (int)(cos(x)*10), 1.0f);
add_pixel(pixelmap, (int)(rows/2 + cos(x)*1.1), x, 1.0f);
render_pixelmap(pixelmap);
}
return 0;
Expand Down

0 comments on commit 8246d15

Please sign in to comment.