From d574b72ec7478ae598ad049bb9bdf41d7a5ca681 Mon Sep 17 00:00:00 2001 From: Willem Haffmans Date: Sat, 7 Dec 2024 20:35:48 +0100 Subject: [PATCH] point should be doubles --- inc/fdf.h | 8 ++++---- src/fdf_rotations.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/fdf.h b/inc/fdf.h index be76a11..2cc7991 100644 --- a/inc/fdf.h +++ b/inc/fdf.h @@ -22,7 +22,7 @@ # include "libft.h" # include "MLX42.h" -#define WRONG_LINE_LENGTH "Error: wrong line length. Expected %d, got %d\n" +#define WRONG_LINE_LENGTH "Error: wrong line length. Expected %d, got %d in line nr %d\n" #define MALLOC_ERROR "Error: malloc failed\n" #define FILE_ERROR "Error: could not open file %s\n" #define USAGE_ERROR "Usage: %s \n" @@ -32,9 +32,9 @@ typedef struct s_point { - float x; - float y; - float z; + double x; + double y; + double z; } t_point; typedef struct s_map diff --git a/src/fdf_rotations.c b/src/fdf_rotations.c index 4848d91..0ddbe5e 100644 --- a/src/fdf_rotations.c +++ b/src/fdf_rotations.c @@ -3,7 +3,7 @@ void rotate_x(t_point **points, double angle, int size) { int i; - int previous_y; + double previous_y; i = 0; while (i < size) @@ -17,7 +17,7 @@ void rotate_x(t_point **points, double angle, int size) void rotate_y(t_point **points, double angle, int size) { int i; - int previous_x; + double previous_x; i = 0; while (i < size) @@ -31,8 +31,8 @@ void rotate_y(t_point **points, double angle, int size) void rotate_z(t_point **points, double angle, int size) { int i; - int previous_x; - int previous_y; + double previous_x; + double previous_y; i = 0; while (i < size)