• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Recent Posts

How to check if a point is inside of a polygon?

How to check if a point is inside of a polygon?

Suppose you have a with $n$ sides. This is called a $n$-glon. Basics about polygones A $n$-glon can be defined by a list of $n$ points. Note that the order is important: [A, B, C, D, E, F, G] != [A, B, C, D, F, E, G] I will … Read More »
How to check if two line segments intersect

How to check if two line segments intersect

You have to line segments and you want to know if they intersect. I'll give you an algorithm how to do it. Test cases First of all, we should think about how lines can be arranged: Testcase T1 Testcase T2 Testcase T3 Testcase T4 Testcase T5 Testcase T6 Testcase F1 … Read More »
Reflecting a point over a line

Reflecting a point over a line

It's astonishing how difficult it is to find a good explanation how to reflect a point over a line that does not use higher math methods. So here is my explanation: You have a point $P = (x,y)$ and a line $g(x) = m \cdot x + t$ and you want … Read More »
How to check if a point is inside a rectangle

How to check if a point is inside a rectangle

A rectangle I've just found this interesting question on StackExchange: If you have a rectangle ABCD and point P. Is P inside ABCD? The idea The idea how to solve this problem is simply beautiful. If the point is in the rectangle, it divides it into four triangles: Divided rectangle … Read More »
Sichtweite des Burdsch Chalifa

Sichtweite des Burdsch Chalifa

Aufgabenstellung Der Burdsch Chalifa war 2010 das höchste Gebäude der Erde. Bis zur Spitze sind es 830 m. Angenommen, die Erde wäre eine perfekte Kugel mit einem Radius von 6370 km und die Sicht wäre nicht durch Nebel, Wolken oder sonstige Hindernisse eingeschränkt. Aus welcher Entfernung, die man über die … Read More »
  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor