function y=mysin(x)
% Calculates sin(x) via Taylor series calculation
% sin(x) = x - x^3/3! + x^5/5! - x^7/7! + 
% Note that x can be a vector

	N=100; % how many members in Taylors series
	y=0;   % initialization
	% note that we always use x in the odd power so its power will be expressed
	% as k=(2*i-1)
	for i=1:N
		k=(2*i-1);
		y = y + ((-1)^(i+1)) * (x.^(k))/(factorial(k));
	end
end

