title: Draw sector by center point, radius, interior angle and azymuth in postgis
body: <p>I'm building a javascript application using Bing Maps API, and I would like to make up sector geometries from center points and sector parameters.</p>
  <p>I have a table 'points' in PostgreSQL database with PostGIS on top and it contains point geometries:</p>
  <pre><code>id  st_astext(geom)
  1   POINT(4.331 50.869)
  2   POINT(4.323 50.832)
  3   POINT(4.373 50.853)
  4   POINT(4.356 50.837)
  </code></pre>
  <p>I have another table 'segemnts' where each entry has following attributes: azimuth (in degrees), beamwidth (in degrees), range (in meters) and centerid that is basically foreign key to 'points' table:</p>
  <pre><code>centerid    azimuth beamwidth   range
  1           210     60          750
  2           135     30          500
  3           80      60          600
  4           165     90          750
  </code></pre>
  <p>How do I get a table or a view in my database to select circle segments that have above points as a center point, range as radius, beamwidth as interior angle, and azimuth as a direction?</p>
  <p><a href="https://i.stack.imgur.com/6JNkL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6JNkL.png" alt="enter image description here" /></a></p>