42_cub3d/utils.c
Gregory Robledo bc2d42d941 add texture
2024-10-17 16:32:01 +02:00

33 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: grobledo <grobledo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 12:38:40 by mcolonna #+# #+# */
/* Updated: 2024/10/17 13:43:50 by grobledo ### ########.fr */
/* */
/* ************************************************************************** */
#include "algo.h"
#include <stdarg.h>
void vector_from_rotation(t_point_double *vec, double angle, double norm)
{
vec->x = sin(angle) * norm;
vec->y = -cos(angle) * norm;
}
void write_err(const char *str, ...)
{
va_list args;
va_start(args, str);
write(2, "Error\n", 6);
while (str)
{
write(2, str, ft_strlen(str));
str = va_arg(args, const char *);
}
}