function [x, y] = protinani_zpet(souradnice, uhly)
% Vypocet souradnic bodu protinanim zpet
% Dano: souradnice tri bodu (xy), dva uhly

dx_ab = souradnice(1,1) - souradnice(2,1);
dy_ab = souradnice(1,2) - souradnice(2,2);
dx_bc = souradnice(2,1) - souradnice(3,1);
dy_bc = souradnice(2,2) - souradnice(3,2);

a = 1/tan(uhly(1)/200*pi);
b = 1/tan(uhly(2)/200*pi);
dx_mb = dx_ab + a*dy_ab;
dy_mb = dy_ab - a*dx_ab;
p = dy_mb + dy_bc + b*dx_bc;
q = dx_mb + dx_bc - b*dy_bc;
K = -p/q;
L = -q/p;
J = K + L;
Q = (dy_mb + K*dx_mb)/J;

x = Q + souradnice(2,1);
y = souradnice(2,2) + L*Q;
