![]() |
![]() |
![]() |
procedure InterpolatePoints(const points: TPathD; tension: integer = 0): TPathD;
Performs Hermite Interpolation on a series of points that are horizontally equidistant.
The tension parameter indicates the relative weighting toward horizontality around individual points with -1 indicating less tension (less horizontal) and +1 indicating more.
uses Img32, Img32.Fmt.PNG, Img32.Draw, Img32.Extra; ... var i: integer; img: TImage32; points, path: TPathD; begin points := MakePathD([10,100, 60,50, 110,50, 160,10, 210,100]); path := InterpolatePoints(points, 0); img := TImage32.Create(220,320); DrawLine(img, path, 3, clBlue32, esSquare); for i := 0 to High(points) do DrawPoint(img, points[i], 3, clRed32); img.SaveToFile('interpolate.png'); img.Free;
![]() |
Copyright ©2019 Angus Johnson - Image32 ver. 4.0 - Documentation last updated on 20-January-2022