|
|
Line 1: |
Line 1: |
− | ==Definition==
| + | #REDIRECT TPAMean |
− | <source lang="scar" lines="false">
| |
− | function TPAMiddle(const TPA: TPointArray): TPoint;
| |
− | </source>
| |
| | | |
− | ==Availability==
| + | [[Category:Deprecated Functions]] |
− | SCAR Divi 3.26 > Current
| |
− | | |
− | ===Aliases===
| |
− | *MiddleTPA (SCAR Divi 3.20 > 3.35)
| |
− | | |
− | ==Description==
| |
− | This function determines the arithmetic mean of all x and y coordinates in the given [[TPointArray]] '''TPA''', and returns this as a [[TPoint]] (rounded down). An extended function with additional functionality is available as [[TPAMiddleEx]].
| |
− | | |
− | ==Example==
| |
− | <source lang="scar">
| |
− | var
| |
− | TPA: TPointArray;
| |
− | MiddlePoint: TPoint;
| |
− |
| |
− | begin
| |
− | TPA := [Point(0, 0), Point(2, 2), Point(5, 10)];
| |
− | MiddlePoint := TPAMiddle(TPA);
| |
− | WriteLn('Middle-Point(' + IntToStr(MiddlePoint.x) + ',' + IntToStr(MiddlePoint.y) + ')');
| |
− | end.
| |
− | </source>
| |
− | | |
− | Output:
| |
− | Middle-Point(2,4)
| |
− | | |
− | ==See Also==
| |
− | *[[TPAMiddleEx]]
| |
− | *[[TPADimensions]]
| |
− | *[[TPAArea]]
| |
− | *[[TPADensity]]
| |
− | | |
− | [[Category:Functions]]
| |
− | [[Category:TPA Functions]]
| |
− | [[Category:Array Functions]] | |