% knownAngleConstraint - Affine transform constraints given a known angle.
%
% Function calculates centre and radius of the constraint
% circle in alpha-beta space generated by having a known
% angle between two lines in an affine image
%
% Usage: [c, r] = knownAngleConstraint(la, lb, theta)
%
% Where: la and lb are the two lines defined using homogeneous coords.
% theta is the known angle between the lines.
% c is the 2D coordinate of the centre of the constraint circle.
% r is the radius of the centre of the constraint circle.
% Peter Kovesi April 2000
% Department of Computer Science
% The University of Western Australia
% Equations from Liebowitz and Zisserman
function [c, r] = knownAngleConstraint(la, lb, theta)
a = -la(2)/la(1); % direction of line la
b = -lb(2)/lb(1); % direction of line lb
c = [(a+b)/2, (a-b)/2*cot(theta)];
r = abs( (a-b)/(2*sin(theta)) );