Find the points in a plane using reflection

151 Views Asked by At

I have been trying with no avail to think of a way to divide a plane into two halves by using a perpendicular bisector. If you notice in figure a below, if the original line AB lies on X-axis, the plane can be divided easily (into right hand side of cd and left hand side of cd) by using the following algorithm in MATLAB:

xvec1=minx:(c-minx)/(0.5*nr_x-1):c; %% this gives the left half of the plane
xvec2=c:(maxx-c)/(0.5*nr_x-1):maxx; %% this gives the right half of the plane

yvec1=miny:(maxy-miny)/(nr_y-1):maxy;  %% y goes from minimum to max

[x1,y1]=meshgrid(xvec1,yvec1);
[x2,y2]=meshgrid(xvec2,yvec2);

where c is the center (which could be any mindpoint of AB, minx, miny, maxx, maxy are the maximum points in the plane, and nr_x , nr_y are the number of points between the minimum and maximum)

But, if the original line is tilted by some angle alpha as seen in figure b (in the original case alpha was zero), I can't seem to generalize it so that I can divide a plane into two parts. I would really appreciate if someone could help me in this seemingly straightforward problem, which is not working as expected.

Figure a and b shows the original line AB which is divided by CD to two planes (notice in figure a, lines are exaggerated to make it visible)