# 'PIE' Define/Draw Pie Slice

> Source: https://manual.pvxplus.com/mnemonics/pie

**GUI Display/Printer**

## Formats

|  |  |  |
| --- | --- | --- |
| 1\. | *Draw Pie (Starting/Ending Angles)* | 'PIE'(*x,y,radius,aspect,angle_1,angle_2*) |
| 2\. | *Draw Pie (Radial Coordinates)* | 'PIE'(*x,y,radius,aspect,startRadialX,startRadialY,endRadialX,endRadialY*) |

***Where:***

|  |  |
| --- | --- |
| *angle_1* | Angle (in degrees) measured counter clockwise from the right-center (3 o'clock) position of the pie circle to the ***starting*** point of the pie slice. Numeric expression. |
| *angle_2* | Angle (in degrees) measured counter clockwise from the right-center (3 o'clock) position of the pie circle to the ***ending*** point of the pie slice. Numeric expression. |
| *aspect* | Aspect ratio/viewpoint. (Ratio=1 results in no tilt.) Numeric expression. |
| *startRadialX  <br>startRadialY* | Coordinates along a line that extends from the center of the pie, in graphical units. The point where this line intersects with the pie circle defines the ***start*** of the pie slice. Numeric expression. |
| *endRadialX  <br>endRadialY* | Coordinates along a line that extends from the center of the pie, in graphical units. The point where this line intersects with the pie circle defines the ***end*** of the pie slice. Numeric expression. |
| *radius* | Radius of the pie, in graphical units. Numeric expression. |
| *x,y* | Coordinates for the center of the pie, in graphical units. Numeric expression. |

*(Support for the Radial Coordinates format was added in PxPlus 2020.)*

## Description

Use **'PIE'** to draw (print) a pie slice on the device (e.g. terminal). Use graphical units or **@X(col) / @Y(line)** functions for *x*,*y* and *radius*.

When drawing the pie slice, it can extend in ***either*** of two ways:

- ***From*** starting *angle_1* ***to*** ending *angle_2* ***OR***
- ***From*** where the line (defined by ***startRadialX*** and ***startRadialY***) intersects with the pie circle ***to*** where the line (defined by ***endRadialX*** and ***endRadialY***) intersects with the pie circle

The **'PIE'** mnemonic uses current attributes for the **'FILL'** and **'PEN'** mnemonics.

For PDFs and Windows graphical drawing, entering a ratio=0 means no ratio. A ratio \<0 is invalid and results in an Error 29: Invalid Mnemonic or position specification.

## See Also

**[@X(col) / @Y(line) Convert X/Y Coordinates](https://manual.pvxplus.com/functions/x)  
['FILL' Define Fill Style](https://manual.pvxplus.com/mnemonics/fill)**  
**['PEN' Define Pen Style](https://manual.pvxplus.com/mnemonics/pen)**

## Example

These examples display a pie cut into two uneven slices:

|  |  |  |
| --- | --- | --- |
|  | print 'pen'(1,3,8),'fill'(2,6)  <br>print 'pie'(224,450,100,1,45,1)  <br>print 'pen'(1,3,6),'fill'(4,15)  <br>print 'pie'(260,440,100,1,1,45) | ![](https://manual.pvxplus.com/migration-assets/9b0252937dea6990dbced5c78361de7dbe00a964c4642b3c639364e1649eb848.png) |
|  | print 'pen'(1,3,8),'fill'(2,6)  <br>print 'pie'(224,450,100,1,274,400,324,447)  <br>print 'pen'(1,3,6),'fill'(4,15)  <br>print 'pie'(260,440,100,1,360,437,310,390) | ![](https://manual.pvxplus.com/migration-assets/032f003e8a9dab1eed3087a536700227bfed632f50ebc31dced5b9db4df02c8b.png) |
