Previous Topics:
Some Geometric Primitives:
Q1. Let there are two point p1 and p2. Now draw a line through p1 and p2. If we have a point q, we will determine that q is to the left or right of p1p2 line. A solution has been given in previous post ( see the above link). Now I will discuss another simple solution.
From above figure, a line goes through A and B points. We want to determine that q to the left of AB line or not. We draw a parallel line of X-axis. This line intersect the point C(x4,y3). If x4 > x3 then, the point q is not to the left of the line AB.
We know the equation of the line passing through the points A and B is,
Implementations:
1) Normal C++ Code:
2) Turbo C++(graphical Environment)
Next Topics:
No comments:
Post a Comment