# Vector

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

```lua
Vector Vector( number x = 0, number y = 0, number z = 0 )
```

```lua
Vector Vector( Vector vector )
```

```lua
Vector Vector( string vectorString )
```

## Açıklama

Bir [Vector](https://gmod.tr/wiki/Vector) nesnesi oluşturur.

> **UYARI:** Vector oluşturmak, nesne oluşturma ve çöp toplama (garbage collection) nedeniyle sık çalışan hook'larda veya çok sık çağrı gerektiren işlemlerde (örneğin döngüler) kullanıldığında nispeten maliyetlidir. Vektörü bir değişkende saklamak veya mevcut olan [varsayılan vektörleri](https://gmod.tr/wiki/Global_Variables#misc) kullanmak daha iyidir. Bkz. [Vector:Add](https://gmod.tr/wiki/Vector:Add).

## Varsayılan Argümanlar

1. [number](https://gmod.tr/wiki/number) **x** = 0: Vektörün x bileşeni.
2. [number](https://gmod.tr/wiki/number) **y** = 0: Vektörün y bileşeni.
3. [number](https://gmod.tr/wiki/number) **z** = 0: Vektörün z bileşeni.

Argüman Aşırı Yüklemesi: Vektör Kopyalama

1. [Vector](https://gmod.tr/wiki/Vector) **vector**: Verilen [Vector](https://gmod.tr/wiki/Vector)'ün bir kopyası olan yeni bir [Vector](https://gmod.tr/wiki/Vector) oluşturur.

Argüman Aşırı Yüklemesi: Metin Ayrıştırma

1. [string](https://gmod.tr/wiki/string) **vectorString**: Girdi [string](https://gmod.tr/wiki/string)'ini bir [Vector](https://gmod.tr/wiki/Vector)'ün [print](https://gmod.tr/wiki/Global.print) formatından ayrıştırmaya çalışır. [string](https://gmod.tr/wiki/string) ayrıştırılamazsa, `x`, `y`, ve `z` değerleri `0` olarak ayarlanmış bir [Vector](https://gmod.tr/wiki/Vector) döndürür.

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

1. [Vector](https://gmod.tr/wiki/Vector): Oluşturulan vektör nesnesi.

### Örnek

Bir vektör oluşturur ve değerini konsola yazdırır.

```lua
print( Vector( 1, 2, 3 ) )
print( Vector( "4 5 6" ) )
local test = Vector( 7, 8, 9 )
print( Vector( test ) )

print( Vector( "4 5 test" ) )
print( Vector() )
```

**Çıktı:**

```lua
1.000000 2.000000 3.000000
4.000000 5.000000 6.000000
7.000000 8.000000 9.000000

0.000000 0.000000 0.000000
0.000000 0.000000 0.000000
```

- [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/Global.Vector
