MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / lerp

Method lerp

src/main/java/field/linalg/Vec2.java:301–306  ·  view source on GitHub ↗

Linearly interpolate a and b using the given interpolation factor t and store the result in dest . If t is 0.0 then the result is this . If the interpolation factor is 1.0 then the result is o

(Vec2 a, Vec2 b, double t, Vec2 dest)

Source from the content-addressed store, hash-verified

299 * @return this
300 */
301 public static Vec2 lerp(Vec2 a, Vec2 b, double t, Vec2 dest) {
302 if (dest == null) dest = new Vec2();
303 dest.x = (1.0 - t) * a.x + t * b.x;
304 dest.y = (1.0 - t) * a.y + t * b.y;
305 return dest;
306 }
307
308 /**
309 * Return the dot product of a vector and another.

Callers 7

splitCubicFrameMethod · 0.45
interpolateMethod · 0.45
blendTowardsMethod · 0.45
byFixingEndpointsToMethod · 0.45
getSetColorMethod · 0.45
mixFunction · 0.45
towardsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected