Computational Geometry

« nazaj

Computational geometry - Tutorial 31.3.2021


Polygons

Exercise 1

Draw the diagonals computed by the algorithm you have seen at the lectures to the $x$-monotone polygon in the figure below.



Exercise 2

We are given a polygon as a list of vertices, but we do not know whether they are given in clockwise or counterclockwise order. Describe an algorithm which finds the order in linear time.



Exercise 3

Describe an algorithm which, given a polygon $P$, finds a direction (if any) in which $P$ is monotone.


A linear time algorithm for this problem exists!


Exercise 4

Write the pseudocode of an algorithm which computes a $3$-colouring of the given triangulation of a polygon in linear time.