#include "raytracer.h"

origin_3d multiply_origin_3d_by_scalar(origin_3d origin_3d_in, double scalar) {
	origin_3d_in.x *= scalar;
	origin_3d_in.y *= scalar;
	origin_3d_in.z *= scalar;
	return origin_3d_in;
}

origin_3d add_origin_3d_together(origin_3d origin_3d_in_x, origin_3d *origin_3d_in_y) {
	origin_3d_in_x.x += origin_3d_in_y->x;
	origin_3d_in_x.y += origin_3d_in_y->y;
	origin_3d_in_x.z += origin_3d_in_y->z;
	return origin_3d_in_x;
}

origin_3d get_point_along_vector_3d(vector_3d *vector_3d_in, double scalar) {
	origin_3d scaled_direction = multiply_origin_3d_by_scalar(vector_3d_in->direction, scalar);
	return add_origin_3d_together(vector_3d_in->origin, &scaled_direction);
};

camera init_camera(origin_3d origin, double distance_to_canvas, double width_canvas_pixel_spacing, double height_canvas_pixel_spacing) {
	camera new_camera;
	new_camera.origin = origin;
	new_camera.distance_to_canvas = distance_to_canvas;
	new_camera.width_canvas_pixel_spacing = width_canvas_pixel_spacing;
	new_camera.height_canvas_pixel_spacing = height_canvas_pixel_spacing;
};
