-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathray.c
29 lines (26 loc) · 827 Bytes
/
ray.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
27
28
29
/*
* Filename : ray.c
* Last Modified: 19 June 2020
* Owner : Group 20
*
* Description:
* This file contains the definitions of the functions whose declarations are
* specified in ray.h.
*
* Other:
* This file is formatted with a tab indent size of 4 and a character
* restriction of 80/line.
*/
/*----------------------------User-defined Headers----------------------------*/
#include "ray.h"
#include "vec.h"
/*---------------------------Function Declarations----------------------------*/
/*================================Constructors================================*/
void ray_set(ray *r, vec ogn, vec des) {
r->ogn = ogn;
r->des = des;
}
/*==============================Unary Operations==============================*/
vec point_at(float t, ray r) {
return add(r.ogn, mul_c(r.des, t));
}