Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

DrawingTools

Guides

  • DrawingTools

Tech Notes

  • Testing for Points on Border or Interior of a Polygon

Symbols

  • Arrow3D
  • ArrowCylinder
  • ArrowSlab
  • ConicSurface
  • EmptyRectangle
  • HollowCylinder
  • HollowPillar
  • InPolygonQ
  • LineToCable
  • OnBoundaryQ
  • Patches
  • Pillar
  • Pyramid3D
  • Spin3D
  • SpinningTop
  • StackGraphics
  • StringToCurves
  • StringToPolygons
  • Wiggly
QuantumMob`DrawingTools`
InPolygonQ
​
InPolygonQ
[poly,pt]
returns True if point
pt
is on the border or inside of polygon
poly
and False otherwise.
​
Examples  
(1)
Basic Examples  
(1)
In[1]:=
poly={{0,4},{7,4},{7,-3},{-2,-3},{0,2},{5,2},{3,-2},{-4,3},{-5,0},{-3,-3},{0,4}};​​pts={{-3,-1},{5,3},{2,1},{-2,4},{-1.85,-1.5},{-0.6,1.5}};​​Graphics[{Polygon@poly,Red,PointSize[0.02],Point/@pts,​​MapThread[Text[Framed[#1],#2,-{1,1}]&,{Range@Length@pts,pts}]},​​PlotRangePadding1]
Out[1]=
In[2]:=
more={poly〚2〛,0.27poly〚2〛+0.73poly〚3〛};​​Graphics[{Polygon@poly,PointSize[0.02],Red,Point/@pts,​​MapThread[Text[Framed[#1],#2,-{1,1}]&,{Range@Length@pts,pts}],Blue,Point/@more},​​PlotRangePadding1]
Out[2]=
In[3]:=
OnBoundaryQ
[poly,#]&/@Join[pts,more]
Out[3]=
{False,False,False,False,False,False,True,True}
In[4]:=
InPolygonQ
[Polygon@poly,#]&/@Join[pts,more]
Out[4]=
{True,True,True,False,False,True,True,True}
SeeAlso
OnBoundaryQ
TechNotes
▪
Testing for Points on Border or Interior of a Polygon
RelatedGuides
▪
DrawingTools
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com