clc;clear all;
L1=1.6;
L2=1.6;
prompt = 'Enter Joint1 angle';
gamma = input(prompt)

prompt = 'Enter Joint2 angle';
beta2 = input(prompt)

prompt = 'Enter Joint3 angle';
beta1 = input(prompt)

alfa1 = beta1+45;
alfa2 = beta2+120;




V= L1*cos(alfa1) + cos(180 - alfa1 - alfa2)*L2;
Tz= L1*sin(alfa1) - sin(180 - alfa1 - alfa2)*L2;

Rx= L1*cos(alfa1)* cos(gamma);
Ry= L1*cos(alfa1) *sin(gamma);
Rz=L1*sin(alfa1);

Ty = V*sin(gamma);
Tx = V*cos(gamma);

% grid on;

xlabel('x(t)')
ylabel('y(t)')
zlabel('z(t)')

plot3([1 0 1],[0 0 0],[Rx Ry Rz],[Tx Ty Tz],'k-')
grid on


