% ::::::::::::: Messung : schiefer Winkel  anhand  Cosinus-Satz ::::::::
% ::::::::::::::::::: mit Skalar-Product  &  Vector Norm ::::::::::::::::::::::::::::::::
close all; clear all; clf;
fprintf(1, '\n')   
disp(['°°°°°°°°°°°°° S T A R T °°°°°°°°°°°° ' ,date, ' °°°°°°°°°°°°°°'])
format compact
% :::: Winkel in Ecke A gesucht ::::
C = [5 5 1]';
B = [6 1 2]';
A = [1 0 4]';
% :::::: vectors :::::
a = C-B;
b = C-A;
c = B-A;
ABC = [a b c]
% :::::: Vector - Norm ::::::
aNorm = norm(c)
bNorm = norm(b)
% ::::::::: Scalar Product ::::::::::::
EckeA = b' *c;    dotA = dot(b,c);
% ::::::::::::::::: Cosinus-Satz ::::::::::::::
CosiG = EckeA / (aNorm*bNorm)
angG = acos(CosiG)*180/pi
% ::::::::::::. Design : Graphics ::::::::
hp = plot3(A,B,C,'r-o');
set(hp, 'MarkerSize', 10, 'Linewidth',2);
xlabel('\bf XXX')
ylabel('\bf YYY')
% ...... Result ........
ht = title('\bf Winkel Gamma >> in Ecke ');
set(ht, 'Fontsize', 14, 'color', 'r');
pause(1)
hold on
grid on
% :::::::::::: Plot: angG  ::::::::::::::::::::::::


Phi = linspace(0,angG, 10)* pi/180;
R = 0 : 1 : size(ABC,2);
[theta, ra] = meshgrid(Phi,  R);
% ::::::::::::::::: convert: Cylindrical to Cartesian coordinates :::::::::
x = ra.*cos(theta);
y = ra.*sin(theta);
Z = zeros(size(x));
hm = mesh(x, y, Z)
set(hm, 'EdgeColor', 'b','Edgealpha', 0.99, 'FaceColor', 'none');  

rotate3d