Get the point between 2 other points using weights

Hello. I have another algorithm issue.

I have 2 weights.

Weight 1 (W1) is between 0 and 1.

Weight 2 (W2) is the “opposite” of W1. W2 = Mathf.Abs(W1 - 1.0f)

I have 2 points.

When W1 is 1.0 the final point is Point 1.

When W2 is 1.0 the final point is Point 2.

When W1 and W2 is 0.5 the final point is the midpoint of Point 1 and Point 2.

How many dimensions is your point? If it’s 2 dimensional, you can use Vector2.Lerp(Point1, Point2, W2). For 3 dimensional points, you can use the same function with Vector3.

If you don’t want to use the built in functions, the mathematics behind it are as such:

vectorBetweenPoints = Point2 - Point1;

finalValue = Point1 + (vectorBetweenPoints * W2);