Post Reply 
(21S) The Intersection Point of a Quadrilateral
03-02-2021, 03:27 PM (This post was last modified: 03-02-2021 03:28 PM by Albert Chan.)
Post: #3
RE: (21S) The Intersection Point of a Quadrilateral
(02-27-2021 05:28 PM)Albert Chan Wrote:  Let quadrilateral vertices be A,B,C,D, P = intersection of diagonals AC, BD

P = A + k*(C-A) = B + k2*(D-B)       // for some values of k, k2, both between 0 to 1

k*(C-A) + k2*(B-D) = B-A

Previous post had D = (0,0), to simplify calculations.
If we instead let A = (0,0), it simplified more:

k*C + k2*(B-D) = B

Redo previous example, using complex numbers.

lua> I = require'complex'.I
lua> function det(z1,z2) return z1:real()*z2:imag() - z1:imag()*z2:real() end

lua> B, C, D = -1+4*I, 4+6*I, 5-I       -- assumed A = 0
lua> P = det(D,B) / det(C,B-D) * C      -- det(B,B-D) = det(B,B) - det(B,D) = det(D,B)
lua> P:real(), P:imag()
1.3571428571428572       2.0357142857142856
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (21S) The Intersection Point of a Quadrilateral - Albert Chan - 03-02-2021 03:27 PM



User(s) browsing this thread: 1 Guest(s)