Linearly interpolates between two values by the factor defined in [code]weight[/code]. To perform interpolation, [code]weight[/code] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If the [code]from[/code] and [code]to[/code] arguments are of type [int] or [float], the return value is a [float]. If both are of the same vector type ([Vector2], [Vector3] or [Color]), the return value will be of the same type ([code]lerp[/code] then calls the vector type's [code]linear_interpolate[/code] method). [codeblock] lerp(0, 4, 0.75) # Returns 3.0 lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Returns Vector2(2, 3.5) [/codeblock] See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep].
Doğrusal olarak iki sayı arasında, sınırlandırma öğesine (0 ila 1 arasında) göre ara değer hesaplar (interpolate). [method inverse_lerp] yönteminin tersi görevindedir. [code]from[/code] ve [code]to[/code]değerleri [int] tamsayı ya da [float] kayan noktalı sayı tipindeyse, dönüş değeri bir kayan noktalı sayıdır. Eğer ikisi de aynı vektör tipinde([Vector2], [Vector3] veya[Color]) ise, dönüş değeri aynı türde olacaktır ([code]lerp[/code] yöntemi, işlemi yürütürken vektör tipinin [code]lerp[/code] yöntemini çağırıyor). [codeblock] lerp(0, 4, 0.75) # Çıktı:3.0 lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Sonuç: Vector2(2, 3.5) [/codeblock]
If the [code]from[/code] and [code]to[/code] arguments are of type [int] or [float], the return value is a [float].
If both are of the same vector type ([Vector2], [Vector3] or [Color]), the return value will be of the same type ([code]lerp[/code] then calls the vector type's [code]linear_interpolate[/code] method).
[codeblock]
lerp(0, 4, 0.75) # Returns 3.0
lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Returns Vector2(2, 3.5)
[/codeblock]
See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep].
[code]from[/code] ve [code]to[/code] değerleri [int] tamsayı ya da [float] kayan noktalı sayı tipindeyse, dönüş değeri bir kayan noktalı sayıdır.
Eğer ikisi de aynı vektör tipinde([Vector2], [Vector3] veya[Color]) ise, dönüş değeri aynı türde olacaktır ([code]lerp[/code] yöntemi, işlemi yürütürken vektör tipinin [code]lerp[/code] yöntemini çağırıyor).
[codeblock]
lerp(0, 4, 0.75) # Çıktı:3.0
lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Sonuç: Vector2(2, 3.5)
[/codeblock]