In: Computer Science
Using Matlab, Write a script that validates the relationship between sin u, cos u, and tan u by evaluating these functions at suitably chosen values. Please screenshot Matlab screen. Thank you!
clear;
clc;
% according to trignometric angles formula,
% tan(ϑ) = sin(ϑ)/cos(ϑ)
% to check whether both have accuracy,
% we can know presicion of angles we have to
% find the difference
% sin(ϑ)/cos(ϑ) - tan(ϑ)
% majority of values have high presicion.
% values are approximate untill e^-16
angle = 0;
presicion = sin(angle)./cos(angle) - tan(angle)
angle = pi./2;
presicion = sin(angle)./cos(angle) - tan(angle)
angle = pi;
presicion = sin(angle)./cos(angle) - tan(angle)
angle = 3*pi./2;
presicion = sin(angle)./cos(angle) - tan(angle)
angle = 2*pi;
presicion = sin(angle)./cos(angle) - tan(angle)
angle = 2.*pi./3;
presicion = sin(angle)./cos(angle) - tan(angle)
angle = 5.*pi./3;
presicion = sin(angle)./cos(angle) - tan(angle)
Code
Output