Mathematics: Distance 3D

The following table shows what queries are implemented and gives you an easy lookup for the source code. The acronyms are point (PNT), line (LIN), ray (RAY), segment (SEG), plane (PLN), triangle (TRI), rectangle (RCT), circle (CIR), ellipse (ELL), aligned box (ABX), oriented box (OBX), orthogonal frustum (FRU), tetrahedron (TET), polyhedron (PHD), halfspace (HSP), sphere (SPH), ellipsoid (EPD), capsule (CAP), cone (CON), cylinder (CYL), and torus (TOR). Selecting a table entry will load the source code in a separate browser tab. If you are looking for a query that is not in this table, send us a request and we will try to schedule time to implement it.

  PNT LIN RAY SEG PLN TRI RCT CIR ELL ABX OBX FRU TET PHD HSP SPH EPD CAP CON CYL TOR
PNT - - - - - - -
LIN - - - - - - - - - - - -
RAY - - - - - - - - - - - - -
SEG - - - - - - - - - - - - -
PLN - - - - - - - - - - - - - - - - - - - -
TRI - - - - - - - - - - - - -
RCT - - - - - - - - - - - - -
CIR - - - - - - - - - - - - - - - - - -
ELL - - - - - - - - - - - - - - - - - - - - -
ABX - - - - - - - - - - - - -
OBX - - - - - - - - - - - - -
FRU - - - - - - - - - - - - - - - - - - - -
TET - - - - - - - - - - - - - - - - - - - -
PHD - - - - - - - - - - - - - - - - - - - -
HSP - - - - - - - - - - - - - - - - - - - - -
SPH - - - - - - - - - - - - - - - - - - - - -
EPD - - - - - - - - - - - - - - - - - - - -
CAP - - - - - - - - - - - - - - - - - - - - -
CON - - - - - - - - - - - - - - - - - - - - -
CYL - - - - - - - - - - - - - - - - - - - -
TOR - - - - - - - - - - - - - - - - - - - - -



Template definition for distance and closest-point queries.
Point-linear distance queries: point-line, point-ray, point-segment
Point-planar distance queries: point-circle, point-plane, point-rectangle, point-triangle
Point-volumetric distance queries: point-alignedbox, point-orientedbox, point-tetrahedron, point-ellipsoid, point-frustum
Linear-linear distance queries: line-line, line-ray, line-segment, ray-ray, ray-segment, segment-segment. The DistanceSegmentsRobust files have a new implementation for segment-segment that is robust and works in any dimension. The PDF file has a description of the new algorithm.
Linear-planar distance queries: line-circle, line-rectangle, line-triangle, ray-rectangle, ray-triangle, segment-rectangle, segment-triangle
Linear-volumetric distance queries: line-alignedbox, line-orientedbox, ray-alignedbox, ray-orientedbox, segment-alignedbox, segment-orientedbox
Planar-planar distance queries: rectangle-rectangle, triangle-rectangle, triangle-triangle, circle-circle
Planar-volumetric distance queries: triangle-alignedbox, triangle-orientedbox, rectangle-alignedbox, rectangle-orientedbox
Volumetric-volumetric distance queries: alignedbox-alignedbox, alignedbox-orientedbox, orientedbox-orientedbox