// Mathematical operations with scalars
//
// resource: https://www.w3schools.com/js/js_arithmetic.asp
// 1) Compute the following equations, returning the result:
// a) (a + b) * c
// b) a - b / c
// c) a * b / (c^2 + d) * e / (f + g)
// d) a * (b + c) * (d / e) * (f % g)
// 2) Compute the equations in 1) by breaking down each operation, saving them in new variables, then return the result. The resulting code should be equivalent to the code in 1).
scalarOperations_1a = function(a, b, c, d, e, f, g){
return -1;
};
scalarOperations_1b = function(a, b, c, d, e, f, g){
return -1;
};
scalarOperations_1c = function(a, b, c, d, e, f, g){
return -1;
};
scalarOperations_1d = function(a, b, c, d, e, f, g){
return -1;
};
scalarOperations_2a = function(a, b, c, d, e, f, g){
return -1;
};
scalarOperations_2b = function(a, b, c, d, e, f, g){
return -1;
};
scalarOperations_2c = function(a, b, c, d, e, f, g){
return -1;
};
scalarOperations_2d = function(a, b, c, d, e, f, g){
return -1;
};
// Mathematical operations with vectors
//
// For addition of vectors, follow the syntax:
// var result = vec3.add(vec3.create(), a, b);
// For subtraction of vectors, follow the syntax:
// var result = vec3.subtract(vec3.create(), a, b);
// To scale a vector by a scalar, follow the syntax:
// var result = vec3.scale(vec3.create(), a, s);
// To compute the dot product (equivalent to multiply) of two vectors, follow the syntax:
// var result = vec3.dot(a, b);
// To normalize a vector (v / ||v||), follow the syntax:
// var result = vec3.normalize(vec3.create(), a);
//
// 3) Compute the following equations, given that a,b,c are vec3, and d,e,f,g are scalars. Return the result:
// a) (a + b) * c
// b) a - b * d
// c) a * b / (c^2 + d) * e / (f + g)
// d) a * (b * c) * (d / e) * (f % g)
// e) normalize(a * (b * c))
vectorOperations_3a = function(a, b, c, d, e, f, g){
return -1;
};
vectorOperations_3b = function(a, b, c, d, e, f, g){
return vec3.create();
};
vectorOperations_3c = function(a, b, c, d, e, f, g){
return -1;
};
vectorOperations_3d = function(a, b, c, d, e, f, g){
return vec3.create();
};
vectorOperations_3e = function(a, b, c, d, e, f, g){
return vec3.create();
};