Intersección de Segmentos de Recta (2) Geometría Computacional, MAT-125

Documentos relacionados
Intersección entre segmentos de recta. comp-420

CONTROLADORA PARA PIXELS CONPIX

MANUAL EASYCHAIR. A) Ingresar su nombre de usuario y password, si ya tiene una cuenta registrada Ó

Propedéutico de Programación

Flashcards Series 5 El Agua

Flashcards Series 3 El Aeropuerto

74 Prime Time. conjetura Suposición acerca de un patrón o relación, basada en observaciones.

Real Time Systems. Part 2: Cyclic schedulers. Real Time Systems. Francisco Martín Rico. URJC. 2011

Ejercicios Input/Output 11 de Mayo, 2013

Brief Introduction to Docking and Virtual Screening with Autodock4 and Autodock Tools

ARTICULO: 5810 Sistema de Posicionador Digital para Actuador Eléctrico Digital Positioning System for Electric Actuator

Matemáticas Muestra Cuadernillo de Examen

Repaso de funciones exponenciales y logarítmicas. Review of exponential and logarithmic functions

Puede pagar facturas y gastos periódicos como el alquiler, el gas, la electricidad, el agua y el teléfono y también otros gastos del hogar.

Flashcards Series 1 Saludos y Despedidas

TECHNOLOGY ENHANCED LANGUAGE LEARNING MODULE Module on Las partes del cuerpo humano

PELICULAS CLAVES DEL CINE DE CIENCIA FICCION LOS DIRECTORES LOS ACTORES LOS ARGUMENTOS Y LAS ANECD

English-Spanish Helpful Handouts Page 1 of 5. Preposiciones para indicar relaciones espaciales Prepositions Of Location. el cuadro

TU EMBARAZO Y EL NACIMIENTO DEL BEBE GUIA PARA ADOLESCENTES EMBARAZADAS TEEN PREGNANCY AND PARENTI

Los seres vivos/ living things. CONOCIMIENTO DEL MEDIO 3º DE PRIMARIA

EXAMEN DEL CAPÍTULO, 2B

School Preference through the Infinite Campus Parent Portal

TOUCH MATH. Students will only use Touch Math on math facts that are not memorized.

Particiones binarias del espacio (BSP)

TTL GATES. INEL4207 Digital Electronics

Connection from School to Home Kindergarten Math Module 2 Topic A. Making 3 with Triangles and Chips

Agustiniano Ciudad Salitre School Computer Science Support Guide Second grade First term

NOTICE OF ERRATA MEDICARE Y USTED 2006 October 18, 2006

EXERCISES. product of one of them by the square of the other takes a maximum value.

Disfruten su verano! Hola estudiantes,

Vocabulario: Realidades 2B

Learning Masters. Early: Force and Motion

Learning Chapter 2: Reasoning and Proof. Monday, September 21 st, 2015 Period 6

TALLER 1 FORMAS DE REPRESENTACIÓN

EL PODER DEL PENSAMIENTO FLEXIBLE DE UNA MENTE RAGIDA A UNA MENTE LIBRE Y ABIERTA AL CAMBIO BIBLIOTECA WALTER

Welcome to lesson 2 of the The Spanish Cat Home learning Spanish course.

Voc # Expresiones de tiempo para describir el pasado Expresiones con EL PRETÉRITO

Instructor: She just said that she s Puerto Rican. Escucha y repite la palabra Puerto Rican -for a man-.

Nueva confirmación de pedido de compra con cambios: proveedor ES

Manejo de Riesgos de Especies Invasivas Planeación HACCP The 5 Steps of HACCP Stewart Jacks

Change of Plea Waiver of Rights Segment

1) Through the left navigation on the A Sweet Surprise mini- site. Launch A Sweet Surprise Inicia Una dulce sorpresa 2016

Diseño y fabricación de expositores PLV. Design and fabrication of POP displays

Alumnos: Familiarizarse con el código y su uso y resolver las cuestiones planteadas utilizando el intérprete de LISP.

Lectura/Artes del lenguaje Grado 5 Comillas con diálogo

International Olympiad in Informatics July 2011, Pattaya City, Thailand. Loros (Parrots)

Speak Up! In Spanish. Young s Language Consulting. Young's Language Consulting. Lesson 1 Meeting and Greeting People.

Synergy Spanish Solutions. Día de San Valentín Audio Lessons

A cenar! 58 A primera vista Vocabulario y gramática en contexto

V.- V.-El El manejo de de las las Interrupciones

Instructions For Use. STEP 1 Locate the area on your horse that you wish to patch.

School Food and Nutrition Services Facilities Management Services

Shortcut to Informal Spanish Conversations Level 2 Lesson 1

Árboles binarios de búsqueda ( BST )

Arm Theraband Exercises: Lying

Other verbs that have irregular stems in the future tense are: A. Look at each sentence and write the infinitive form of the underlined verb.

Health in Peru, Prepared by Leigh Campoamor

The power to control diabetes is in your hands.

DISPARADORES EN SQL DISPARADORES EN SQL:1999 SINTAXIS GENERAL DE UN DISPARADOR EN SQL:1999 SINTAXIS GENERAL DE UN DISPARADOR EN SQL:1999

Creating your Single Sign-On Account for the PowerSchool Parent Portal

Vamos a Multiplicar Al estilo maya!

En la clase A primera vista Vocabulario en contexto Web Code: jcd-0211

PROBLEMAS PARA LA CLASE DEL 20 DE FEBRERO DEL 2008

Dictionary * Diccionario

WEEK 5: KEEP YOUR GUESTS SAFE

Evaluación II Materias Estándar de 4º. Grado

Circuitos Básicos con OAs

Sistemas de impresión y tamaños mínimos Printing Systems and minimum sizes

ADAPTACIÓN DE REAL TIME WORKSHOP AL SISTEMA OPERATIVO LINUX

ARBOLES ARBOLES BINARIOS ORDENADOS. REPRESENTACIÓN Y OPERACIONES

Estructuras de Datos. Dr. Pablo E. Fidel Martínez López Lic. en Ciencias de la Computación UNR

ASI HABLO ZARATUSTRA UN LIBRO PARA TODOS Y PARA NADIE SPANISH EDITION

Conditioning Exercises: Standing

PARTE COMÚN INGLÉS. 19 de junio de 2008 IES/CIFP DATOS DEL ASPIRANTE. Puntuación total

Qué viva la Gráfica de Cien!

Español. Learn a language your way! Lesson #2 - De dónde eres exactamente? PDF - Beginner.

CUANDO LA MUSA SE HACE VERBO VERSOS CORTOS POEMAS DE AMOR POEMAS DE DESAMOR Y POEMAS CORTOS SPANISH EDITION

7 Posibilidades de ingresos

KAISSA Manual Rápido De Usuario. Rev 1.0

Manual de Arduino Wifly Shield

Celebrando Kwanzaa. La historia de Kwanzaa

CESVA USB DRIVER. M_CUD_v0001_ _ESP_ENG

Hourly Time Reporting

6 th Grade Spring Break Math Activities Instructions (Spanish)

ANEXO I: GUÍA DE ENTREVISTA A DOCENTES DE INGLES QUE TRABAJARON EN LA ASIGNATURA DESDE EL TRIUNFO DE LA EVOLUCIÓN.

)+ Online Read Entrenamiento en Funciones Ejecutivas. Inhibicin de Respuesta. Cuaderno 2.: Fichas para trabajar Funciones Ejecutivas...

FICHA DE REPASO: ESTADÍSTICA

Los Mandatos Commands Por: Martha Abeille Profesora de Español

Notación Asintótica 2

Los bloques DLL (Figura A.1) externos permiten al usuario escribir su propio código y

In English, present progressive can be used to describe what is happening now, or what will happen in the future.

Sistema!de!iluminación!de!un!longboard!

Entrevista: el medio ambiente. A la caza de vocabulario: come se dice en español?

Estudio de idiomas en el dominio.es

Plural (more than one más de uno)

Events Men (12) Women (6) Freestyle 57 kg 65 kg 74 kg 86 kg 97 kg 125 kg Greco-Roman 59 kg 66 kg

EMPLOYER & EMPLOYEE RETIREMENT PLAN TAX CREDITS

Filma la escena! (Film the scene!) Escribe el guión! (Write the script!)

El Lenguaje PL/SQL. Un lenguaje de propósito general orientado a la inclusión de sentencias SQL. Estructura del código PL/SQL.

Mi ciudad interesante

Transcripción:

Intersección de Segmentos de Recta (2) Geometría Computacional, MAT-125

Qué estructuras de datos necesitamos para implementar este algoritmo? cola de eventos Q. Operaciones: Eliminar el próximo evento (el más alto abajo de la línea de barrido) en Q y regresar el punto evento. Si dos puntos evento tienen la misma coordenada y, regresar aquel con la coordenada x más pequeña. En una línea horizontal el punto más a la izquierda será el evento superior. l

Insertar un evento. Verificar si un segmento está dentro de Q. Definir un orden en los puntos evento. p q Si p y q son puntos evento, si y solo si p y > q y o si p y = q y, p x < q x. Guardar los puntos evento en un árbol binario balanceado, ordenado de acuerdo a. Con cada punto evento p en Q se deben almacenar también los segmentos que empiecen en p. Ambas operaciones toman O(log m) donde m es el número de eventos en Q. No se utiliza un montículo porque hay que verificar si un evento ya está presente en Q.

Se debe mantener un estado del algoritmo,: una secuencia de segmentos ordenados que intersequen la línea de barrido. La estructura del estado T, se usa para acceder a los vecinos de un segmento dado s, de tal manera que se pueda probar si intersecta con s. La estructura debe ser dinámica ya que los segmentos empiezan o terminan de intersectar a la línea de barrido (se añaden y eliminan). Como hay un orden bien definido en los segmentos dentro de la estructura de estado, se puede usar un árbol binario de búsqueda balanceado. Los segmentos que intersecan la línea de barrido se encuentran en el mismo orden en las hojas del árbol binario de búsqueda.

T s k s i s j s k s l s m l s i s l s i s j s l s m s j s k El orden de izquierda a derecha sobre la línea de barrido corresponde al orden de izquierda a derecha de las hojas de T. Los nodos internos mantienen la información necesaria para guiar la búsqueda hacia abajo. En cada nodo interno, almacenamos el segmento más a la derecha en el subárbol izquierdo.

Supongamos que buscamos en T al segmento inmediatamente a la izquierda de un punto p sobre la línea de barrido. En cada nodo interno v, probamos si p se encuentra a la izquierda o a la derecha del segmento almacenado en v. Dependiendo de estas prueba bajamos hacia el subárbol izquierdo o al derecho hasta llegar a una hoja. El segmento buscado estará almacenado en esta hoja o en la inmediata izquierda. Cada actualización y búsqueda de vecino toma O(log n). Las únicas estructuras que necesitamos entonces son: La cola de eventos Q. El estado de la línea de barrido T.

Algorithm FINDINTERSECTIONS(S) Input. A set S of line segments in the plane. Output. The set of intersection points among the segments in S, with for each intersection point the segments that contain it. 1. Initialize an empty event queue Q. Next, insert the segment endpoints into Q; when an upper endpoint is inserted, the corresponding segment should be stored with it. 2. Initialize an empty status structure T. 3. while Q is not empty 4. do Determine the next event point p in Q and delete it. 5. HANDLEEVENTPOINT(p) We have already seen how events are handled: at endpoints of segments we

HANDLEEVENTPOINT(p) 1. Let U(p) be the set of segments whose upper endpoint is p; these segments are stored with the event point p. (For horizontal segments, the upper endpoint is by definition the left endpoint.) 2. Find all segments stored in T that contain p; they are adjacent in T. Let L(p) denote the subset of segments found whose lower endpoint is p, and let C(p) denote the subset of segments found that contain p in their interior. 3. if L(p) U(p) C(p) contains more than one segment 4. then Report p as an intersection, together with L(p), U(p), and C(p). 5. Delete the segments in L(p) C(p) from T. 6. Insert the segments in U(p) C(p) into T. The order of the segments in T should correspond to the order in which they are intersected by a sweep line just below p. If there is a horizontal segment, it comes last among all segments containing p. 7. ( Deleting and re-inserting the segments of C(p) reverses their order. ) 8. if U(p) C(p) = /0 9. then Let s l and s r be the left and right neighbors of p in T. 10. FINDNEWEVENT(s l,s r, p) 11. else Let s be the leftmost segment of U(p) C(p) in T. 12. Let s l be the left neighbor of s in T. 13. FINDNEWEVENT(s l,s, p) 14. Let s be the rightmost segment of U(p) C(p) in T. 15. Let s r be the right neighbor of s in T. 16. FINDNEWEVENT(s,s r, p) Note that in lines 8 16 we assume that s and s actually exist. If they do not

FINDNEWEVENT(s l,s r, p) 1. if s l and s r intersect below the sweep line, or on it and to the right of the current event point p, and the intersection is not yet present as an event in Q 2. then Insert the intersection point as an event into Q.

T s 1 s 5 s 4 s 1 s 7 s 8 s 7 s 4 s 8 s 7 s 5 s 4 s 1 s 5 l T s 2 s 1 s 2 s 1 s 7 s 2 s 1 s 8 s 7