# math.CubicBezier

- **Ortam:** İstemci, Sunucu, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/math.CubicBezier
- **Çeviri tarihi:** 2025-09-08

```lua
Vector math.CubicBezier( number frac, Vector p0, Vector p1, Vector p2, Vector p3 )
```

## Açıklama

Kübik bezier kullanarak 4 kontrol noktası arasında bir nokta enterpole eder (Lerp işlemi yapar).

3 kontrol noktasıyla çalışan benzer bir fonksiyon için [math.QuadraticBezier](https://gmod.tr/wiki/math.QuadraticBezier) sayfasına bakın.

## Argümanlar

1. [number](https://gmod.tr/wiki/number) **frac**: Sonucu bulmak için kullanılan kesir. Bu sayı 0 ile 1 arasında sınırlandırılır.
2. [Vector](https://gmod.tr/wiki/Vector) **p0**: İlk kontrol noktası
3. [Vector](https://gmod.tr/wiki/Vector) **p1**: İlk teğet
4. [Vector](https://gmod.tr/wiki/Vector) **p2**: İkinci teğet
5. [Vector](https://gmod.tr/wiki/Vector) **p3**: İkinci kontrol noktası

## Döndürülen Değer

1. [Vector](https://gmod.tr/wiki/Vector): Belirtilen kesirde kontrol noktaları arasındaki nokta

### Örnek

Bu fonksiyonun kullanımını gösterir.

```lua
local points = {
	Vector( 128, 128 ),
	Vector( 384, 128 ),
	Vector( 384, 384 ),
	Vector( 128, 384 )
}

hook.Add( "HUDPaint", "math.CubicBezier", function()
	local frac = RealTime() % 1
	local point = math.CubicBezier( frac, points[1], points[2], points[3], points[4] )

	surface.SetDrawColor( 255, 255, 0 )
	surface.DrawRect( point.x - 4, point.y - 4, 8, 8 )

	surface.DrawRect( points[1].x - 4, points[1].y - 4, 8, 8 )
	surface.DrawRect( points[2].x - 4, points[2].y - 4, 8, 8 )
	surface.DrawRect( points[3].x - 4, points[3].y - 4, 8, 8 )
	surface.DrawRect( points[4].x - 4, points[4].y - 4, 8, 8 )
end )
```

**Çıktı:** ![](https://gmod.tr/api/uploads/wiki/3391a018951cf069bd15.gif)

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/math.CubicBezier
