The struct s_color stores the color values of ray tracing. It contains a field for red,...
Definition: tuples.h:63
Tuple means a list of ordered things. The struct t_tuple stores coordinates for a left-handed coordin...
Definition: tuples.h:33
t_color subtract_color(t_color a, t_color b)
The function subtract_color() decreases the intensity of each RGB color component of a and b....
Definition: colors.c:31
struct s_tuple t_tuple
Tuple means a list of ordered things. The struct t_tuple stores coordinates for a left-handed coordin...
t_tuple vector(double x, double y, double z)
This function is a simplification of the function tuple(). It will create a point with the given coor...
Definition: models.c:25
struct s_color t_color
The struct s_color stores the color values of ray tracing. It contains a field for red,...
t_tuple t_point
The type t_point is a syntatic sugar for any structure t_tuple whose w's field equals to 1,...
Definition: tuples.h:44
t_tuple normalize(t_tuple vector)
The function normalize() takes an arbitrary vector and converts it into a unit vector....
Definition: vector_math.c:27
t_color hadamard_product(t_color a, t_color b)
The function hadamard_product() blends two color together by multiplying corresponding components of ...
Definition: colors.c:49
t_color new_color(double red, double green, double blue)
The function new_color() instances a new color of struct type s_color with the given values passed as...
Definition: colors.c:15
t_tuple tuple(double x, double y, double z, double w)
The function tuple() instances a new material of struct type t_tuple with the given values passed as ...
Definition: models.c:15
t_tuple cross(t_tuple a, t_tuple b)
The function cross() multiplies vectors, instead of tuples. After all, the ray traces only needs a th...
Definition: vector_math.c:50
t_color add_color(t_color a, t_color b)
The function add_color() combines the intensity of each RGB color component of a and b....
Definition: colors.c:22
t_tuple divide(t_tuple a, double scalar)
The function divide() divides a vector by a scalar value, i.e., it changes the vector length uniforml...
Definition: basic_math.c:55
t_tuple negate(t_tuple a)
The function negate() returns the opposite vector of a given vector passed as parameter....
Definition: basic_math.c:35
t_tuple subtract(t_tuple a, t_tuple b)
The subtract() function subtract two tuples. A vector minus a point results in a point (w values: 1 -...
Definition: basic_math.c:25
t_tuple add(t_tuple a, t_tuple b)
The add() function sums two tuples. A vector plus a point results in a point (w values: 1 + 0 = 1)....
Definition: basic_math.c:15
t_color multiply_color(t_color color, double scalar)
The function multiply_color() scales the intensities of each RGB color component of the parameter col...
Definition: colors.c:40
t_tuple reflect(t_tuple in, t_tuple normal)
This function returns the result of reflecting the in vector around the normal vector.
Definition: vector_math.c:59
t_tuple point(double x, double y, double z)
This function is a simplification of the function tuple(). It will create a point with the given coor...
Definition: models.c:20
double magnitude(t_tuple vector)
The function magnitude() gets the magnitude or length of a given vector passed as parameter....
Definition: vector_math.c:15
t_tuple multiply(t_tuple a, double scalar)
The function multiply() multiplies a vector by a scalar value, i.e., it changes the vector length uni...
Definition: basic_math.c:45
t_tuple t_vector
The type t_point is a syntatic sugar for any structure t_tuple whose w's field equals to 0,...
Definition: tuples.h:50
double dot(t_tuple a, t_tuple b)
The function dot() computes the sum of the products of the corresponding components of each vector....
Definition: vector_math.c:40