Difference between revisions of "TPAExtractPie"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> procedure TPAExtractPie(var TPA: TPointArray; const Center: TPoint; const RMin, RMax, AStart, AEnd: Extended); </source> ==Avai...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
==Description== | ==Description== | ||
− | Extracts | + | Extracts points from a given [[TPointArray]] '''TPA''' by removing all points that are not inside of the given "pie" area. '''Center''' determines the center of the pie you are using. '''AStart''' and '''AEnd''' are the starting and ending angles given in radians which defines the slice of the pie area you which to extract. '''RMin''' and '''RMax''' represent the minimum and maximum radius from the center point int between which the extractable points are found. If '''RMin''' > '''RMax''' or '''AStart''' > '''AEnd''', then the function will return without extracting any points. |
==Example== | ==Example== | ||
Line 28: | Line 28: | ||
==See Also== | ==See Also== | ||
+ | *[[TPAFilterPie]] | ||
+ | *[[TPAExtractCircle]] | ||
+ | *[[TPAExtractTriangle]] | ||
*[[TPAExtractBoxes]] | *[[TPAExtractBoxes]] | ||
− | |||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:TPA Functions]] | [[Category:TPA Functions]] | ||
[[Category:Array Functions]] | [[Category:Array Functions]] |
Latest revision as of 13:02, 21 November 2012
Definition
procedure TPAExtractPie(var TPA: TPointArray; const Center: TPoint; const RMin, RMax, AStart, AEnd: Extended);
Availability
SCAR Divi 3.28 > Current
Description
Extracts points from a given TPointArray TPA by removing all points that are not inside of the given "pie" area. Center determines the center of the pie you are using. AStart and AEnd are the starting and ending angles given in radians which defines the slice of the pie area you which to extract. RMin and RMax represent the minimum and maximum radius from the center point int between which the extractable points are found. If RMin > RMax or AStart > AEnd, then the function will return without extracting any points.
Example
var TPA: TPointArray; begin TPA := [Point(0, 0), Point(2, 2), Point(2, 3), Point(5, 10)]; WriteLn(TPAToStr(TPA)); TPAExtractPie(TPA, Point(0, 0), 2.5, 3, Pi / 8, 7 * Pi / 8); WriteLn('Extracted: ' + TPAToStr(TPA)); end.
Output:
(0,0);(2,2);(2,3);(5,10) Extracted: (2,2)