Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Point in polygon
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== SVG === Similar methods are used in [[Scalable Vector Graphics|SVG]] for defining a way of filling with color various shapes (such as path, polyline, polygon, text etc.).<ref>{{Cite web|title=Painting: Filling, Stroking, Colors and Paint Servers β SVG Tiny 1.2|url=https://www.w3.org/TR/2008/REC-SVGTiny12-20081222/painting.html#FillProperties|access-date=2021-07-24|website=www.w3.org}}</ref> The algorithm of filling is influenced by 'fill-rule' attribute. The value may be either {{Code|nonzero}} or {{Code|evenodd}}. For example, in a [[pentagram]], there is a central "hole" (visible background) with {{Code|evenodd}}, and none with {{Code|nonzero}} attribute.<ref>{{Cite web|title=Painting: Filling, Stroking, Colors and Paint Servers β SVG Tiny 1.2|url=https://www.w3.org/TR/2008/REC-SVGTiny12-20081222/painting.html#FillProperties|access-date=2021-07-24|website=www.w3.org}}</ref> For [[simple polygons]], the algorithms will give the same result. However, for [[complex polygons]], the algorithms may give different results for points in the regions where the polygon intersects itself, where the polygon does not have a clearly defined inside and outside. One solution using the even-odd rule is to transform (complex) polygons into simpler ones that are even-odd-equivalent before the intersection check.<ref>{{cite conference |author=Michael Galetzka, Patrick Glauner |year=2017 |title=A Simple and Correct Even-Odd Algorithm for the Point-in-Polygon Problem for Complex Polygons |conference=Proceedings of the 12th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications ([[VISIGRAPP]] 2017), Volume 1: GRAPP }}</ref> This, however, is computationally expensive. It is less expensive to use the fast non-zero winding number algorithm, which gives the correct result even when the polygon overlaps itself.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)