SlideServe
Menu
Préférences
© SlideServe · v2026

2D Intersection Visualization Techniques for Line Segments

chad avatar
7 diapositives · 196 Views · Jul 24, 2014

Explore methods for determining intersections of geometric figures in 2D space, focusing on line segments with known or unknown geometry and algebraic approaches for solving line equations. Learn visual transformations and calculations for efficient intersection detection.

2D Intersection Visualization Techniques for Line Segments - slide 1
01 / 72D Intersection Visualization Techniques for Line Segments
1 / 17

Télécharger la présentation

2D Intersection Visualization Techniques for Line Segments
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Lecture 04:Intersection January 29, 2013 COMP 150-2Visualization

  2. Admin • Citing other people’s work • Online references • Grading • Note: the “posting online” requirement will be judged during the time of the demo. If the page doesn’t load, the student will not receive credit. There will be no “real time debugging”! • Grading Rubric • frame.setResizable(true); • Caveat – does not work in a browser!!

  3. Testing for 2D Intersections • With known geometry (e.g. with a circle, or with a square) • With known geometry, but rotated/translated/scaled/sheared (affine transforms) • Transformation stack – inverse transform • Isomorphic shapes (applies to invertible deformation) • With geometry made up of defined line segments • With unknown geometry

  4. Line-Line Intersection • Given two points P(Px, Py), Q(Qx, Qy) • Solve for the line equation: • ax + by = c • Start by finding y = mx + d • Note that m is the slope… • Plug in the numbers, solve for m and d • Rearrange to find a, b, c • General form: • (py – qy)x + (qx – px)y = (qxpy - pxqy)

  5. Line-Line Intersection • Given ax + by = c for two line segments, find it they intersect • a1x + b1y = c1 • a2x + b2y = c2 • Multiply the top equation by b2, bottom by b1 • a1b2 x + b1b2 y = c1b2 • a2b1 x + b1b2 y = c2b1 • Subtract bottom by top • (a1b2 –a2b1)x = (c1b2 –c2b1) • X = (c1b2 – c2b1) / (a1b2 – a2b1); • Multiply the top equation by a2, bottom by a1 • a1a2 x + b1a2 y = c1a2 • a1a2 x + b2a1 y = c2a1 • Same as above, get • Y = (c1a2 – c2a1) / (b1a2 – b2a1), //which is the same as • Y = (c2a1 – c1a2) / (b2a1 – b1a2); //rearrange the det • Y = (c2a1 – c1a2) / (a1b2 – a2b1);

  6. Line-Line Intersection double det = A1*B2 - A2*B1 if(det== 0) { //Lines are parallel } else { double x = (B2*C1 - B1*C2)/det double y = (A1*C2 - A2*C1)/det } //need to check for the range if doing line-segment to line-segment test

  7. Questions?