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`
OnBoundaryQ
​
OnBoundaryQ
[{
p
1
,
p
2
,…},pt]
returns
True
if point
pt
is on the boundary represented by points
{
p
1
,
p
2
,…}
.
​
​
OnBoundaryQ
[
Line
[{
p
1
,
p
2
,…}],pt]
or
OnBoundaryQ
[
Line
[{{
p
11
,
p
12
,…},{
p
21
,
p
22
,…}}],pt]
​ works similarly.
​
​
OnBoundaryQ
[
Polygon
[{
p
1
,
p
2
,…}],pt]
is also possible and works as expected.
​
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}]},​​ImageSizeMedium]
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},ImageSizeMedium,PlotRangePadding1]
Out[2]=
In[3]:=
OnBoundaryQ
[poly,#]&/@Join[pts,more]
Out[3]=
{False,False,False,False,False,False,True,True}
In[4]:=
OnBoundaryQ
[Line@poly,#]&/@Join[pts,more]
Out[4]=
{False,False,False,False,False,False,True,True}
In[5]:=
OnBoundaryQ
[Line@{poly,poly},#]&/@Join[pts,more]
Out[5]=
{False,False,False,False,False,False,True,True}
In[6]:=
OnBoundaryQ
[Polygon@poly,#]&/@Join[pts,more]
Out[6]=
{False,False,False,False,False,False,True,True}
SeeAlso
InPolygonQ
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