back to <a
<h2>New SQL functions supporting Circles and Ellipses introduced in 4.1.0</h2>
<table width="%100" cellpadding="8" cellspacing="8">
<tr><td>
<b>MakeCircle</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i> )<br>
<b>MakeCircle</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i>, <i>srid</i> )<br>
<b>MakeCircle</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i>, <i>srid</i>, <i>step</i> )<hr>
Will return a closed <b>Linestring</b> approximating a circle.<ul>
<li><b>cx</b> and <b>cy</b> are the coordinates identifying the centre.</li>
<li>both <b>radius</b> and <b>srid</b> are self-explanatory.</li>
<li>the optional argument <b>step</b> defines how many points will be interpolated on the curve. <b>step</b> corresponds to an <u><i>angular measured in two consecutive points will be separated by this distance.</li>
</ul>
</td><td colspan="2" align="center"><img alt="circle"><br>
<verbatim>
SELECT MakeCircle(0, 0, 100, -1, 1);

<tr><td>
<b>MakeEllipse</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i> )<br>
<b>MakeEllipse</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i>, <i>srid</i> )<br>
<b>MakeEllipse</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i>, <i>srid</i>, <i>step</i> )<hr>
Will return a closed <b>Linestring</b> approximating an ellipse.<ul>
<li><b>cx</b>, <b>cy</b>, <b>srid</b> and <b>step</b> have exactly the same identical meaning as before.</li>
<li><b>x_axis</b> and <b>y_axis</b> define respectively the horizontal and vertical axes of the ellipse.</li>
</ul>
</td><td><img alt="ellipse-1"><br>
<verbatim>
SELECT MakeEllipse(0, 0, 100, 50,
    -1, 1);

</td><td><img alt="ellipse-2"><br>
<verbatim>
SELECT MakeEllipse(0, 0, 50, 100,
    -1, 1);

<tr><td>
<b>MakeArc</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i>, <i>start</i>, <i>stop</i> )<br>
<b>MakeArc</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i>, <i>start</i>, <i>stop</i>, <i>srid</i> )<br>
<b>MakeArc</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i>, <i>start</i>, <i>stop</i>, <i>srid</i>, <i>step</i> )<hr>
Will return a <b>Linestring</b> approximating a circular arc.<ul>
<li><b>cx</b>, <b>cy</b>, <b>radius</b> and <b>step</b> are exactly as above.</li>
<li><b>start</b> and <b>stop</b> define the extreme points of the arc; both are expressed in The arc will be always drawn in direction.</li>
</ul>
</td><td><img alt="arc-1"><br>
<verbatim>
SELECT MakeArc(0, 0, 100,
    30, 150, -1, 1);

</td><td><img alt="arc-2"><br>
<verbatim>
SELECT MakeArc(0, 0, 100,
    30, 150, -1, 1);

<tr><td>
<b>MakeEllipticArc</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i>, <i>start</i>, <i>stop</i> )<br>
<b>MakeEllipticArc</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i>, <i>start</i>, <i>stop</i>, <i>srid</i> )<br>
<b>MakeEllipticArc</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i>, <i>start</i>, <i>stop</i>, <i>srid</i>, <i>step</i> )<hr>
Will return a <b>Linestring</b> approximating an elliptic arc.<br>
</td><td><img alt="elliptic-arc-1"><br>
<verbatim>
SELECT MakeEllipticArc(0, 0, 50, 100,
    30, 150, -1, 1);

</td><td><img alt="elliptic-arc-2"><br>
<verbatim>
SELECT MakeEllipticArc(0, 0, 50, 100,
    150, 30, -1, 1);

<tr><td>
<b>MakeCircularSector</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i>, <i>start</i>, <i>stop</i> )<br>
<b>MakeCircularSector</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i>, <i>start</i>, <i>stop</i>, <i>srid</i> )<br>
<b>MakeCircularSector</b> ( <i>cx</i>, <i>cy</i>, <i>radius</i>, <i>start</i>, <i>stop</i>, <i>srid</i>, <i>step</i> )<hr>
Will return a <b>Polygon</b> approximating a circular sector.
</td><td><img alt="circular-sector-1"><br>
<verbatim>
SELECT MakeCircularSector(0, 0, 100,
    330, 30, -1, 1);

</td><td><img alt="circular-sector-2"><br>
<verbatim>
SELECT MakeCircularSector(0, 0, 100,
    30, 330, -1, 1);

<tr><td>
<b>MakeEllipticSector</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i>, <i>start</i>, <i>stop</i> )<br>
<b>MakeEllipticSector</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i>, <i>start</i>, <i>stop</i>, <i>srid</i> )<br>
<b>MakeEllipticSector</b> ( <i>cx</i>, <i>cy</i>, <i>x_axis</i>, <i>y_axis</i>, <i>start</i>, <i>stop</i>, <i>srid</i>, <i>step</i> )<hr>
Will return a <b>Polygon</b> approximating an elliptic sector.
</td><td><img alt="elliptic-sector-1"><br>
<verbatim>
SELECT MakeEllipticSector(0, 0, 100, 50,
    330, 30, -1, 1);

</td><td><img alt="elliptic-sector-2"><br>
<verbatim>
SELECT MakeEllipticSector(0, 0, 100, 50,
    30, 330, -1, 1);

<tr><td>
<b>MakeCircularStripe</b> ( <i>cx</i>, <i>cy</i>, <i>radius_1</i>, <i>radius_2</i>, <i>start</i>, <i>stop</i> )<br>
<b>MakeCircularStripe</b> ( <i>cx</i>, <i>cy</i>, <i>radius_1</i>, <i>radius_2</i>, <i>start</i>, <i>stop</i>, <i>srid</i> )<br>
<b>MakeCircularStripe</b> ( <i>cx</i>, <i>cy</i>, <i>radius_1</i>, <i>radius_2</i>, <i>start</i>, <i>stop</i>, <i>srid</i>, <i>step</i> )<hr>
Will return a <b>Polygon</b> delimited by two circular arcs sharing the same centre but having different radii.
</td><td><img alt="circular-stripe-1"><br>
<verbatim>
SELECT MakeCircularStripe(0, 0, 100, 90,
    45, 315, -1, 1);

</td><td><img alt="circular-stripe-2"><br>
<verbatim>
SELECT MakeCircularStripe(0, 0, 50, 150,
    315, 45, -1, 1);

<tr><td>Any function supporting circles and ellipses could obviously be nested with any other Spatial SQL function so to get more elaborate results.<br>
e.g. <b>RotateCoords()</b> and <b>ShiftCoords()</b> could be invoked in order to apply an arbitrary
</td><td colspan="2" align="center"><img alt="tilt-ellipse"><br>
<verbatim>
SELECT RotateCoords( MakeEllipse(0, 0, 100, 20, -1, 1), 45);

</table>

<hr><br>
back to <a