Convex Hull ( Geomatric Primitives-II)

Feb 24, 2013


Previous Topics:

Some Geometric Primitives:


Now let A(x1,y1) and B(x2,y2) are two point. We draw a line passing through A and B. we have a point q(x3, y3). We have to determine the perpendicular distance from the point q to AB line.


Here Cq is the perpendicular on the line AB. The equation of line AB is

Since Cq is the perpendicular of AB line, so the equation of line Cq is,

Cq line passes through the point (x3,y3),
So

AB line and Cq line intersect at point C(x,y).
By solving below equation, we find,

The perpendicular distance from C(x,y) to q(x3,y3) is,

Implementations:


Normal Code:


Turbo C++(graphical Environment):



Next Topics:

No comments:

Post a Comment