interpolate static method
Returns the point that is at the position specified by the interpolation
factor f
between points a
and b
.
The f
parameter represents the position of the interpolation between the
two points as a value between 0.0 and 1.0, where 0.0 represents point a
,
1.0 represents point b
, and values between 0.0 and 1.0 represent points
that are linearly interpolated between a
and b
.
Implementation
static GPoint interpolate(GPoint a, GPoint b, double f) {
return GPoint(a.x + f * (b.x - a.x), a.y + f * (b.y - a.y));
}