MobilityDB 1.3
Loading...
Searching...
No Matches

◆ trapezoid_make()

LWGEOM * trapezoid_make ( const Cbuffer c1,
const Cbuffer c2 
)

Return a trapezoid created from two circular buffers.

Given two circular buffers, c1 and c2, defined by their centres (x1,y1) and (x2,y2) and radii r1 and r2, respectively, the function computes the tangents points between the two circular buffers, and the two points on the two circular buffers that are farthest from each other as illustrated next

T1a(x,y) T2a(x,y)
| |
^ ^
(-)--------------------(-)
(---) (---)
A1(x,y) --> (-----) (-----) <-- A2(x,y)
(---) (---)
(-)--------------------(-)
^ ^
| |
T1b(x,y) T2b(x,y)

In particular, two common external tangent lines, Ta and Tb, intersect both circles at four points

  • T1a(x,y) and T1b(x,y): the points where Ta and Tb touch circle c1.
  • T2a(x,y) and T2b(x,y): the points where Ta and Tb touch circle c2. Additionally, each circle has a point that is farthest from the other circle:
  • A1(x,y) on circle c1: the point between T1a and T1b that is farthest from circle c2.
  • A2(x,y) on circle c2: the point between T2a and T2b that is farthest from circle c1. This function returns the geometry given by the circular bufferss and the two tangent lines.

An example of usage of the function is given next.

SELECT ST_AsText(traversedArea(tcbuffer '[Cbuffer(Point(1 1),1)@2000-01-01,
Cbuffer(Point(3 2),2)@2000-01-02]'), 3);
-- CURVEPOLYGON(COMPOUNDCURVE(
CIRCULARSTRING(1.4 3.2,4.789 2.894,3 0),(3 0,1 0),
CIRCULARSTRING(1 0,0.106 0.553,0.2 1.6),(0.2 1.6,1.4 3.2)))