CLIPLINE |
clips line into given window.
Synopsis:
[x1,y1,x2,y2,inside] = clipline(W,b,window)
Description:
This function returns 2d points (x1,y1) and (x2,y2)
of a line segment given by line
W'*x + b = 0
clipped to the given window.
Input:
W [2x1] Normal of line.
b [1x1] Line threshold.
window [4x1] Contains [left right top bottom].
Output:
x1 [1x1], y1 [1x1] The first point of line segment.
x2 [1x1], y2 [1x1] The second point of line segment.
inside [1x1] 1 if line W'*x+b=0 intersects the window.
Example:
figure; hold on;
axis([-1 1 -1 1]);
window = 0.5*axis;
[x1,y1,x2,y2]=clipline([-1;1],0,window);
plot([x1 x2],[y1 y2]);
About: Statistical Pattern Recognition Toolbox
(C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac
Czech Technical University Prague
Faculty of Electrical Engineering
Center for Machine Perception
Modifications:
30-apr-2004, VF