-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwall.c
26 lines (22 loc) · 1.12 KB
/
wall.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* wall.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sadamant <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/17 14:17:42 by sadamant #+# #+# */
/* Updated: 2018/05/17 14:17:50 by sadamant ### ########.fr */
/* */
/* ************************************************************************** */
#include "wolf3d.h"
/*
** finds the distance and then applies a fisheye correction
*/
double distance(t_ray *r, t_player *p)
{
double dist;
dist = sqrt(pow((p->x - r->x), 2) + pow((p->y - r->y), 2));
dist *= cos(r->a - p->cov);
return (dist);
}