Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
Computational Geometry Package
  • Functions
    • False
    • True
  • Tech Notes
    • Upgrading from Computational Geometry Package
    • Functions
      • False
      • True
    • Tech Notes
      • Upgrading from Computational Geometry Package
OBSOLETE COMPUTATIONAL GEOMETRY PACKAGE TUTORIAL
  • Functions
    • False
    • True
  • Tech Notes
    • Upgrading from Computational Geometry Package
    • Functions
      • False
      • True
    • Tech Notes
      • Upgrading from Computational Geometry Package

Computational Geometry Package

As of Version 10, all the functionality of the ComputationalGeometry package is built into the Wolfram System. »

Computational geometry is the study of efficient algorithms for solving geometric problems. The nearest neighbor problem involves identifying one point, out of a set of points, that is nearest to the query point according to some measure of distance. The nearest neighborhood problem involves identifying the locus of points lying nearer to the query point than to any other point in the set. This package provides functions for solving these and related problems in the case of planar points and the Euclidean distance metric.

ConvexHull[{{x1,y1},{x2,y2},…}]compute the convex hull of a set of points in the plane
DelaunayTriangulation[{{x1,y1},{x2,y2},…}]
compute the Delaunay triangulation of a set of points in the plane
VoronoiDiagram[{{x1,y1},{x2,y2},…}]
compute the Voronoi diagram of a set of points in the plane

Computational geometry functions.

The convex hull of a set S is the boundary of the smallest set containing S. The Voronoi diagram of S is the collection of nearest neighborhoods for each of the points in S. For points in the plane, these neighborhoods are polygons. The Delaunay triangulation of S is a triangulation of the points in S such that no triangle contains a point of S in its circumcircle. This is equivalent to connecting the points in S according to whether their neighborhood polygons share a common side.

This loads the package.
Here is a list of points in the plane.
This gives the indices of the points lying on the convex hull in counterclockwise order.
Duplicate points are ignored.
This gives the counterclockwise vertex adjacency list for each point in the Delaunay triangulation. For example, the entry {1,{4,3,2}} indicates that the first point in data2D is connected in counterclockwise order to the fourth, third, and second points.

While DelaunayTriangulation need only specify the connections between points, VoronoiDiagram must specify both a set of diagram vertices and the connections between those vertices. Another difference between the two functions is that while a triangulation consists of segments, a diagram consists of both segments and rays. For example, in the case of a Voronoi diagram, points in the interior of the convex hull will have nearest neighborhoods that are closed polygons, but the nearest neighborhoods of points on the convex hull will be open polygons.

These considerations make the output of VoronoiDiagram more complex than that of DelaunayTriangulation. The diagram is given as a list of diagram vertices followed by a diagram vertex adjacency list. The finite vertices of the diagram are listed first in the vertex list. The vertices lying at infinity have head Ray and are listed last.

This assigns the list of Voronoi diagram vertices to vorvert and the Voronoi diagram vertex adjacency list to vorval.
The first vertex in vorvert is a finite diagram vertex having coordinates {-0.0158537,8.44146}. The last vertex in vorvert is a point at infinity. This point is represented by a Ray object having origin {10.5172,3.46115} and containing {13.95,0.2}.
Each entry in vorval gives the index of a point in data2D followed by a counterclockwise list of the Voronoi diagram vertices that comprise the point's nearest neighborhood polygon.
Here is the Voronoi polygon vertex adjacency list for the first point in data2D.
This selects the coordinates of the polygon vertices from vorvert. The first two vertices have head List, while the last two have head Ray. Thus, the Voronoi polygon associated with the first point in data2D is open and is defined by a segment and two rays.
VoronoiDiagram[{{x1,y1},{x2,y2},…},delval]
compute the Voronoi diagram using the Delaunay triangulation vertex adjacency list delval
VoronoiDiagram[{{x1,y1},{x2,y2},…},delval,convexhull]
compute the Voronoi diagram using the Delaunay triangulation vertex adjacency list delval and the convex hull index list convexhull

Computing the Voronoi diagram using the Delaunay triangulation and the convex hull.

This computes the Voronoi diagram of data2D more efficiently by making use of the Delaunay triangulation vertex adjacency list.
Here the Voronoi diagram is computed using both the Delaunay triangulation and the convex hull.
PlanarGraphPlot[{{x1,y1},{x2,y2},…}]
plot the Delaunay triangulation of the points
PlanarGraphPlot[{{x1,y1},{x2,y2},…},indexlist]
plot the graph depicted by the counterclockwise list of indices in indexlist
PlanarGraphPlot[{{x1,y1},{x2,y2},…},val]
plot the graph depicted by the vertex adjacency list val
DiagramPlot[{{x1,y1},{x2,y2},…}]plot the Voronoi diagram of the points
DiagramPlot[{{x1,y1},{x2,y2},…},diagvert,diagval]
plot the diagram depicted by the vertex list diagvert and the vertex adjacency list diagval
TriangularSurfacePlot[{{x1,y1,z1},{x2,y2,z2},…}]
plot the surface according to the Delaunay triangulation established by projecting the points onto the x‐y plane
TriangularSurfacePlot[{{x1,y1,z1},{x2,y2,z2},…},trival]
plot the surface according to the triangulation depicted by the vertex adjacency list trival

Computational geometry plotting functions.

The default of PlanarGraphPlot is a plot of the Delaunay triangulation of the points.
This plots the convex hull of the points.
Here is an alternative triangulation.
This plots the triangulation of data2D given by trival.
The default of DiagramPlot is a plot of the Voronoi diagram of the points.
Here is an alternative set of diagram vertices.
Here is an alternative diagram vertex adjacency list.
This plots the diagram of data2D given by diagvert and diagval.
Here is a set of three‐dimensional points having the same x-y coordinates as data2D.
The default of TriangularSurfacePlot is a plot of the z coordinates according to the connectivity established by the Delaunay triangulation of the x-y coordinates.
This plots the z coordinates according to the connectivity established by the triangulation trival.
Compare to the default ListPlot3D behavior.
ConvexHull[{{x1,y1},{x2,y2},…},AllPoints->False]
give the minimum set of points needed to define the convex hull
DelaunayTriangulation[{{x1,y1},{x2,y2},…},Hull->True]
give both the Delaunay triangulation vertex adjacency list and the convex hull
PlanarGraphPlot[{{x1,y1},{x2,y2},…},LabelPoints->False]
plot the Delaunay triangulation without labels
DiagramPlot[{{x1,y1},{x2,y2},…},LabelPoints->False]
plot the Voronoi diagram without labels
DiagramPlot[{{x1,y1},{x2,y2},…},TrimPoints->n]
plot the Voronoi diagram with the outermost ray plus (n-1) of the outermost diagram vertices trimmed

Options for computational geometry functions.

This gives the minimum set of points needed to define the convex hull.
This returns both the Delaunay triangulation and the convex hull.
Here is a set of random numbers uniformly distributed on ×.
This computes the Voronoi diagram of random.
The diagram plot is dominated by outlier vertices.
TrimPoints->2 means that the diagram is plotted so that both the outermost ray and the outermost vertex are eliminated.
The TrimPoints option can be used to magnify the diagram until the points in random fill the plot.
DelaunayTriangulationQ[{{x1,y1},{x2,y2},…},trival]
give True if the vertex adjacency list trival represents a Delaunay triangulation of the points, and False otherwise

Testing for a Delaunay triangulation.

delval is a Delaunay triangulation, so this returns True.
This returns False because trival is not a Delaunay triangulation.
BoundedDiagram[{{a1,b1},{a2,b2},…},{{x1,y1},{x2,y2},…}]
compute the bounded Voronoi diagram of a set of points {x,y}, where the bound is the convex polygon described by the points {a,b}
BoundedDiagram[{{a1,b1},{a2,b2},…},{{x1,y1},{x2,y2},…},delval]
compute the bounded Voronoi diagram using the Delaunay triangulation vertex adjacency list delval
BoundedDiagram[{{a1,b1},{a2,b2},…},{{x1,y1},{x2,y2},…},delval,convexhull]
compute the bounded Voronoi diagram using the Delaunay triangulation vertex adjacency list delval and the convex hull index list convexhull

Computing the bounded Voronoi diagram.

When spatial data is collected within a finite region of the plane, the unbounded Voronoi diagram of the points may not offer an accurate picture of the region of influence of each point. A tile on the periphery of the diagram will be open, indicating an infinite region of influence, when in fact an open tile is simply due to the limited extent of the spatial sampling. It is sometimes useful to intersect the unbounded Voronoi diagram of the data with the boundary of the convex region from which the data was collected. Then each point in the data can be associated with a closed tile or finite region of influence.

BoundedDiagram begins by finding the unbounded Voronoi diagram. It then works counterclockwise around the boundary, integrating bounding polygon vertices into the diagram, and deleting Voronoi diagram vertices falling outside of the boundary. Bounding an open tile of the Voronoi diagram allows you to approximate the true underlying closed tile you would have if the data collection had not been limited to a portion of the plane.

The bounded diagram is represented as two lists: (1) a vertex coordinate list, and (2) a vertex adjacency list, one entry for each point in the original unbounded diagram indicating the associated bounded polygon vertices in counterclockwise order.

Since BoundedDiagram requires the unbounded Voronoi diagram, the computation of the bounded diagram can be made more efficient by providing additional arguments, such as the Delaunay triangulation vertex adjacency list and the convex hull.

These are the coordinates of the rectangular region from which the data2D sample was drawn.
This assigns the list of bounded diagram vertices to diagvert1 and the bounded diagram vertex adjacency list to diagval1.
Here is a plot of the bounded diagram of data2D given by diagvert1 and diagval1.
TileAreas[{{x1,y1},{x2,y2},…},{{q1, q2,…},val}]
find the areas of the tiles centered on {xi,yi} and having vertices qj, as stipulated by the vertex adjacency list val

Computing tile areas.

You can make use of Voronoi diagrams to build spatial interaction models, or simply calculate the area of influence of individual tiles.

In an unbounded Voronoi diagram, some of the tiles have infinite area.
In a bounded diagram, each of the tiles has finite area.
This gives the tile areas scaled by the area of the rectangle from which the sample was drawn.

Related Tech Notes

    ▪
  • Upgrading from Computational Geometry Package
Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English