[CSC 315] Intersecting Line Segments
Andrew J. Pounds
pounds_aj at mercer.edu
Sat Sep 24 06:35:20 EDT 2016
On 09/23/2016 09:58 PM, wrote:
> Ok I've got that implemented. And now it's onto intersection checking.
>
> I've got no idea where to start with that but I'm guessing there's a
> matrix there somewhere
>
>
>
Yep...
So based on the notes, lets say you have a line segment defined by the
points
$(x_1,y_1)$ and $(x_2,y_2)$
and another line segment defined by the points
$(x_3,y_3)$ and $(x_4,y_4)$
You need to calculate the determinants that are shown on page 16 of the
lecture slides. There are only three determinants to be calculated
because the denominators are the same. Calculating the determinants in
the 2D case is really easy as it equals $M_{1,1}M_{2,2}-M_{1,2}M_{2,1}$
where the subscripts refer to the matrix indices. Once you calculate
the determinants then find $u_a$ and $u_b$ by division and if both are
between 0 and 1 the lines intersect.
--
Andrew J. Pounds, Ph.D. (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
http://faculty.mercer.edu/pounds_aj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160924/2995885b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-4.png
Type: image/png
Size: 812 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160924/2995885b/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-3.png
Type: image/png
Size: 855 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160924/2995885b/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-2.png
Type: image/png
Size: 854 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160924/2995885b/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-1.png
Type: image/png
Size: 835 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160924/2995885b/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-5.png
Type: image/png
Size: 1350 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160924/2995885b/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-7.png
Type: image/png
Size: 551 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160924/2995885b/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-6.png
Type: image/png
Size: 556 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160924/2995885b/attachment-0006.png>
More information about the csc315
mailing list