Skip to content

Commit 4982b7c

Browse files
authored
Bezier curve
1 parent a8ea094 commit 4982b7c

File tree

1 file changed

+88
-88
lines changed

1 file changed

+88
-88
lines changed
Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,201 +1,201 @@
1-
# Bezier curve
1+
# Bezier Eğrisi
22

3-
Bezier curves are used in computer graphics to draw shapes, for CSS animation and in many other places.
3+
Bezier eğrileri, bilgisayar grafiklerinde şekiller çizmek için, CSS animasyonları için ve birçok diğer yerlerde kullanılır.
44

5-
They are a very simple thing, worth to study once and then feel comfortable in the world of vector graphics and advanced animations.
5+
Çok basit bir konudur, bir kez çalıştıktan sonra vektör grafikleri ve gelişmiş animasyonlar dünyasında kendinizi rahat hissedebilirsiniz.
66

7-
## Control points
7+
## Kontrol Noktaları
88

9-
A [bezier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) is defined by control points.
9+
Bir [bezier eğrisi](https://tr.wikipedia.org/wiki/B%C3%A9zier_e%C4%9Frisi) kontrol noktaları ile tanımlanır.
1010

11-
There may be 2, 3, 4 or more.
11+
2, 3, 4 (adet) veya daha fazlası
1212

13-
For instance, two points curve:
13+
Örneğin, iki noktalı eğri:
1414

1515
![](bezier2.svg)
1616

17-
Three points curve:
17+
Üç noktalı eğri:
1818

1919
![](bezier3.svg)
2020

21-
Four points curve:
21+
Dört noktalı eğri:
2222

2323
![](bezier4.svg)
2424

25-
If you look closely at these curves, you can immediately notice:
25+
Eğrilere yakından bakarsınız, hemen farkedebilirsiniz:
2626

27-
1. **Points are not always on curve.** That's perfectly normal, later we'll see how the curve is built.
28-
2. **The curve order equals the number of points minus one**.
29-
For two points we have a linear curve (that's a straight line), for three points -- quadratic curve (parabolic), for four points -- cubic curve.
30-
3. **A curve is always inside the [convex hull](https://en.wikipedia.org/wiki/Convex_hull) of control points:**
27+
1. **Noktalar her zaman eğri üzerinde değil.** Bu tamamen normal, daha sonra eğrinin nasıl oluşturulduğunu göreceğiz.
28+
2. **Eğri derecesi, nokta sayısından bir eksiğine eşittir**.
29+
İki nokta için doğrusal bir eğriye sahibiz (düz bir çizgi), üç nokta için -- kuadratik eğri (parabolik), dört nokta için -- kübik eğri.
30+
3. **Bir eğri her zaman kontrol noktalarının [dışbükey gövdesi](https://en.wikipedia.org/wiki/Convex_hull)nin içindedir**:
3131

3232
![](bezier4-e.svg) ![](bezier3-e.svg)
3333

34-
Because of that last property, in computer graphics it's possible to optimize intersection tests. If convex hulls do not intersect, then curves do not either. So checking for the convex hulls intersection first can give a very fast "no intersection" result. Checking the intersection or convex hulls is much easier, because they are rectangles, triangles and so on (see the picture above), much simpler figures than the curve.
34+
Bu son özellik sayesinde, bilgisayar grafiklerinde kesişim testlerini optimize etmek mümkündür. Dışbükey gövdeler (convex hulls) kesişmiyorsa, eğrilerde kesişmez. Dolayısıyla, dışbükey gövde kesişimini kontrol etmek "kesişim yok" sonucunu çok hızlı bir şekilde verebilir. Kesişimi veya dışbükey gövdeleri kontrol etmek çok daha kolaydır, çünkü bunlar dikdörtgenler, üçgenler ve benzerleridir (yukarıdaki görsele bakın), eğriden çok daha basit şekillerdir.
3535

36-
**The main value of Bezier curves for drawing -- by moving the points the curve is changing *in intuitively obvious way*.**
36+
**Bezier eğrilerinin ana önemi -- kontrol noktaları hareket ettirildiğinde *sezgisel olarak bariz bir şekilde* eğri değişiyor.**
3737

38-
Try to move control points using a mouse in the example below:
38+
Aşağıdaki örnekte kontrol noktalarını fareyi (mouse) kullanarak hareket ettirmeyi deneyin:
3939

4040
[iframe src="demo.svg?nocpath=1&p=0,0,0.5,0,0.5,1,1,1" height=370]
4141

42-
**As you can notice, the curve stretches along the tangential lines 1 -> 2 and 3 -> 4.**
42+
**Fark edebileceğiniz gibi, eğri 1 -> 2 ve 3 -> 4 teğet çizgileri boyunca uzanmaktadır.**
4343

44-
After some practice it becomes obvious how to place points to get the needed curve. And by connecting several curves we can get practically anything.
44+
Biraz pratik yaptıktan sonra, istenen eğriyi elde etmek için noktaların nasıl konumlandırılacağı belli olur. Ve birkaç eğriyi birleştirerek, pratik olarak her şeyi elde edebiliriz.
4545

46-
Here are some examples:
46+
İşte bazı örnekler:
4747

4848
![](bezier-car.svg) ![](bezier-letter.svg) ![](bezier-vase.svg)
4949

50-
## De Casteljau's algorithm
50+
## De Casteljau'nun Algoritması
5151

52-
There's a mathematical formula for Bezier curves, but let's cover it a bit later, because
53-
[De Casteljau's algorithm](https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm) it is identical to the mathematical definition and visually shows how it is constructed.
52+
Bezier eğrileri için matematiksel bir formül vardır, fakat bunu daha sonra ele alalım, çünkü
53+
[De Casteljau'nun algoritması](https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm), matematiksel tanımla aynıdır ve nasıl oluşturulduğunu görsel olarak gösterir.
5454

55-
First let's see the 3-points example.
55+
İlk olarak 3 noktalı örneğe bakalım.
5656

57-
Here's the demo, and the explanation follow.
57+
İşte demo ve açıklamaları aşağıda.
5858

59-
Control points (1,2 and 3) can be moved by the mouse. Press the "play" button to run it.
59+
Kontrol noktaları (1,2 ve 3) fare ile hareket ettirilebilir. "play" butonuna basarak çalıştırın.
6060

6161
[iframe src="demo.svg?p=0,0,0.5,1,1,0&animate=1" height=370]
6262

63-
**De Casteljau's algorithm of building the 3-point bezier curve:**
63+
**De Casteljau'nun 3-noktalı bezier eğrisi oluşturma algoritması:**
6464

65-
1. Draw control points. In the demo above they are labeled: `1`, `2`, `3`.
66-
2. Build segments between control points 1 -> 2 -> 3. In the demo above they are <span style="color:#825E28">brown</span>.
67-
3. The parameter `t` moves from `0` to `1`. In the example above the step `0.05` is used: the loop goes over `0, 0.05, 0.1, 0.15, ... 0.95, 1`.
65+
1. Kontrol noktaları çizme. Yukarıdaki örnekte bunlar `1`, `2`, `3` olarak adlandırılmıştır.
66+
2. 1 -> 2 -> 3 kontrol noktaları arasında parçalar oluşturun. Yukarıdaki demoda bunlar <span style="color:#825E28">kahverengidir</span>.
67+
3. `t` parametresi, `0`'dan `1` gider. Yukarıdaki örnekte `0.05` kademe kullanılmıştır: döngü `0, 0.05, 0.1, 0.15, ... 0.95, 1` şeklinde ilerler.
6868

69-
For each of these values of `t`:
69+
Bu `t` değerlerinin her biri için:
7070

71-
- On each <span style="color:#825E28">brown</span> segment we take a point located on the distance proportional to `t` from its beginning. As there are two segments, we have two points.
71+
- Her <span style="color:#825E28">kahverengi</span> parça üzerinde, parçanın başlangıcından `t` ile orantılı uzaklıkta bulunan bir nokta alıyoruz. İki parça olduğundan dolayı iki noktamız var.
7272

73-
For instance, for `t=0` -- both points will be at the beginning of segments, and for `t=0.25` -- on the 25% of segment length from the beginning, for `t=0.5` -- 50%(the middle), for `t=1` -- in the end of segments.
73+
Örneğin, `t=0` için -- her iki nokta da parçaların başlangıcında olacaktır, ve `t=0.25` için -- başlangıcından itibaren parça uzunluğunun 25%'inde, `t=0.5` için -- 50% (ortası), `t=1` için -- parçanın sonunda.
7474

75-
- Connect the points. On the picture below the connecting segment is painted <span style="color:#167490">blue</span>.
75+
- Noktaları birleştirin. Aşağıdaki görselde bağlantı parçası <span style="color:#167490">maviye</span> boyanmıştır.
7676

7777

78-
| For `t=0.25` | For `t=0.5` |
78+
| `t=0.25` için | `t=0.5` için |
7979
| ------------------------ | ---------------------- |
8080
| ![](bezier3-draw1.svg) | ![](bezier3-draw2.svg) |
8181

82-
4. Now in the <span style="color:#167490">blue</span> segment take a point on the distance proportional to the same value of `t`. That is, for `t=0.25` (the left picture) we have a point at the end of the left quarter of the segment, and for `t=0.5` (the right picture) -- in the middle of the segment. On pictures above that point is <span style="color:red">red</span>.
82+
4. Şimdi <span style="color:#167490">mavi</span> parçada, aynı `t` değeri ile orantılı uzaklıkta bir nokta alın. Yani, `t=0.25` için (soldaki görsel) parçanın sol çeyreğinin sonunda bir nokta, ve `t=0.5` için (sağdaki görsel) -- parçanın orta noktasında. Yukarıdaki görsellerde bu nokta <span style="color:red">kırmızıdır</span>.
8383

84-
5. As `t` runs from `0` to `1`, every value of `t` adds a point to the curve. The set of such points forms the Bezier curve. It's red and parabolic on the pictures above.
84+
5. `t`, `0`'dan `1`'e doğru ilerlerken, `t`'nin her değeri eğriye bir nokta ekler. Bu noktaların kümesi Bezier eğrisini oluşturur. Yukarıdaki görsellerde kırmızı ve paraboliktir.
8585

86-
That was a process for 3 points. But the same is for 4 points.
86+
Bu işlemler 3 nokta içindi. Fakat 4 nokta içinde geçerlidir.
8787

88-
The demo for 4 points (points can be moved by a mouse):
88+
4 nokta için demo (noktalar fare ile hareket ettirilebilir):
8989

9090
[iframe src="demo.svg?p=0,0,0.5,0,0.5,1,1,1&animate=1" height=370]
9191

92-
The algorithm for 4 points:
92+
4 nokta için algoritma:
9393

94-
- Connect control points by segments: 1 -> 2, 2 -> 3, 3 -> 4. There will be 3 <span style="color:#825E28">brown</span> segments.
95-
- For each `t` in the interval from `0` to `1`:
96-
- We take points on these segments on the distance proportional to `t` from the beginning. These points are connected, so that we have two <span style="color:#0A0">green segments</span>.
97-
- On these segments we take points proportional to `t`. We get one <span style="color:#167490">blue segment</span>.
98-
- On the blue segment we take a point proportional to `t`. On the example above it's <span style="color:red">red</span>.
99-
- These points together form the curve.
94+
- Kontrol noktalarını parçalarla bağlayın: 1 -> 2, 2 -> 3, 3 -> 4. 3 tane <span style="color:#825E28">kahverengi</span> parça olacak.
95+
- `0` ile `1` aralığındaki her `t` için:
96+
- Bu parçalar üzerinde başlangıçtan `t` ile orantılı uzaklıkta noktalar alıyoruz. Bu noktalar birbirlerine bağlandığında iki (adet) <span style="color:#0A0">yeşil</span> parçamız olur.
97+
- Bu parçalar üzerinde `t` ile orantılı noktalar alıyoruz. Bir <span style="color:#167490">mavi parça</span> elde ederiz.
98+
- Mavi parça üzerinde `t` ile orantılı bir nokta alıyoruz. Yukarıdaki örnekte <span style="color:red">kırmızı</span>.
99+
- Bu noktalar birlikte eğriyi oluşturur.
100100

101-
The algorithm is recursive and can be generalized for any number of control points.
101+
Algoritma tekrarlamalı olup herhangi bir sayıda kontrol noktası için genelleştirilebilir.
102102

103-
Given N of control points:
103+
N tane kontrol noktası verildiğinde:
104104

105-
1. We connect them to get initially N-1 segments.
106-
2. Then for each `t` from `0` to `1`, we take a point on each segment on the distance proportional to `t` and connect them. There will be N-2 segments.
107-
3. Repeat step 2 until there is only one point.
105+
1. N-1 tane parça elde etmek için onları birleştiriyoruz.
106+
2. Sonra `0` ile `1` aralığındaki her `t` için, her parça üzerinde `t` ile orantılı uzaklıkta bir nokta alıyoruz ve onları birleşiriyoruz. N-2 parça olacak.
107+
3. Yalnızca bir nokta kalana kadar 2. adımı tekrarlayın.
108108

109-
These points make the curve.
109+
Bu noktalar eğriyi oluşturur.
110110

111111
```online
112-
**Run and pause examples to clearly see the segments and how the curve is built.**
112+
**Parçaların ve eğrinin nasıl oluşturulduğunu açıkça görmek için örnekleri çalıştırın ve duraklatın.**
113113
```
114114

115115

116-
A curve that looks like `y=1/t`:
116+
`y=1/t`'ye benzeyen bir eğri:
117117

118118
[iframe src="demo.svg?p=0,0,0,0.75,0.25,1,1,1&animate=1" height=370]
119119

120-
Zig-zag control points also work fine:
120+
Zig-zag kontrol noktaları da iyi/sorunsuz çalışır:
121121

122122
[iframe src="demo.svg?p=0,0,1,0.5,0,0.5,1,1&animate=1" height=370]
123123

124-
Making a loop is possible:
124+
Bir ilmek/düğüm oluşturmak mümkündür:
125125

126126
[iframe src="demo.svg?p=0,0,1,0.5,0,1,0.5,0&animate=1" height=370]
127127

128-
A non-smooth Bezier curve (yeah, that's possible too):
128+
Düzgün olmayan bir Bezier eğrisi (evet, bu da mümkün):
129129

130130
[iframe src="demo.svg?p=0,0,1,1,0,1,1,0&animate=1" height=370]
131131

132132
```online
133-
If there's something unclear in the algorithm description, please look at the live examples above to see how
134-
the curve is built.
133+
Algoritma açıklamasında net olamayan bir şey varsa, eğrinin nasıl oluşturulduğunu görmek için lütfen yukarıdaki canlı örneklere bakın.
135134
```
136135

137-
As the algorithm is recursive, we can build Bezier curves of any order, that is: using 5, 6 or more control points. But in practice many points are less useful. Usually we take 2-3 points, and for complex lines glue several curves together. That's simpler to develop and calculate.
138136

139-
```smart header="How to draw a curve *through* given points?"
140-
To specify a Bezier curve, control points are used. As we can see, they are not on the curve, except the first and the last ones.
137+
Algoritma tekrarlamalı olduğundan, herhangi bir düzende Bezier eğrileri oluşturabiliriz, yani: 5, 6 veya daha fazla kontrol noktası kullanarak. Ama pratikte çok sayıda nokta daha az kullanışlıdır. Genellikle 2-3 nokta alırız ve karmaşık çizgiler için birkaç eğriyi birbirleriyle birleştiririz. Bunu geliştirmek ve hesaplamak daha basittir.
141138

142-
Sometimes we have another task: to draw a curve *through several points*, so that all of them are on a single smooth curve. That task is called [interpolation](https://en.wikipedia.org/wiki/Interpolation), and here we don't cover it.
139+
```smart header="Verilen noktalar üzerinden bir eğri nasıl çizilir?"
140+
Bir Bezier eğrisi oluşturmak için kontrol noktaları kullanılır. Gördüğümüz gibi, ilki ve sonuncusu hariç eğri üzerinde değiller.
143141
144-
There are mathematical formulas for such curves, for instance [Lagrange polynomial](https://en.wikipedia.org/wiki/Lagrange_polynomial). In computer graphics [spline interpolation](https://en.wikipedia.org/wiki/Spline_interpolation) is often used to build smooth curves that connect many points.
142+
Bazen başka bir amacımız daha vardır: *birkaç nokta boyunca* bir eğri çizmek, böylece hepsi tek bir eğri üzerinde olur. Bu işleme [intepolasyon](https://tr.wikipedia.org/wiki/%C4%B0nterpolasyon) denir, burada bu konuyu ele almayacağız.
143+
144+
Bu tür eğriler için matematiksel formüller vardır, örneğin [Lagrange polinomu](https://en.wikipedia.org/wiki/Lagrange_polynomial). Bilgisayar grafiklerinde [spline interpolasyonu](https://en.wikipedia.org/wiki/Spline_interpolation) genellikle birçok noktayı birbirine bağlayan düzgün eğriler oluşturmak için kullanılır.
145145
```
146146

147147

148-
## Maths
148+
## Matematik
149149

150-
A Bezier curve can be described using a mathematical formula.
150+
Bir Bezier eğrisi matematiksel bir formül kullanılarak tanımlanabilir.
151151

152-
As we saw -- there's actually no need to know it, most people just draw the curve by moving points with a mouse. But if you're into maths -- here it is.
152+
Gördüğümüz gibi -- aslında bunu bilmeye gerek yok, çoğu insan sadece bir fare ile noktaları hareket ettirerek eğri çizer. Ama matematikle ilgiliyseniz -- işte burada.
153153

154-
Given the coordinates of control points <code>P<sub>i</sub></code>: the first control point has coordinates <code>P<sub>1</sub> = (x<sub>1</sub>, y<sub>1</sub>)</code>, the second: <code>P<sub>2</sub> = (x<sub>2</sub>, y<sub>2</sub>)</code>, and so on, the curve coordinates are described by the equation that depends on the parameter `t` from the segment `[0,1]`.
154+
<code>P<sub>i</sub></code> kontrol noktalarının koordinatları göz önüne alındığında: birinci kontrol noktasının koordinatları <code>P<sub>1</sub> = (x<sub>1</sub>,y<sub>1</sub>)</code>, ikincisinin: <code>P<sub>2</sub> = (x<sub>2</sub>, y<sub>2</sub>)</code>, ve benzer şekilde, eğri koordinatları `[0,1]` aralığındaki `t` parametresine bağlı olan denklemle tanımlanır.
155155

156-
- The formula for a 2-points curve:
156+
- 2 noktalı eğri için formül:
157157

158158
<code>P = (1-t)P<sub>1</sub> + tP<sub>2</sub></code>
159-
- For 3 control points:
159+
- 3 kontrol noktalı için:
160160

161161
<code>P = (1−t)<sup>2</sup>P<sub>1</sub> + 2(1−t)tP<sub>2</sub> + t<sup>2</sup>P<sub>3</sub></code>
162-
- For 4 control points:
162+
- 4 kontrol noktalı için:
163163

164164
<code>P = (1−t)<sup>3</sup>P<sub>1</sub> + 3(1−t)<sup>2</sup>tP<sub>2</sub> +3(1−t)t<sup>2</sup>P<sub>3</sub> + t<sup>3</sup>P<sub>4</sub></code>
165165

166166

167-
These are vector equations. In other words, we can put `x` and `y` instead of `P` to get corresponding coordinates.
167+
Bunlar vektör denklemleridir. Başka bir deyişle, karşılık gelen koordinatları elde etmek için `P` yerine `x` ve `y`'yi koyabiliriz.
168168

169-
For instance, the 3-point curve is formed by points `(x,y)` calculated as:
169+
Örneğin, 3 noktalı eğri şu şekilde hesaplanan `(x,y)` noktaları tarafından oluşturulur:
170170

171171
- <code>x = (1−t)<sup>2</sup>x<sub>1</sub> + 2(1−t)tx<sub>2</sub> + t<sup>2</sup>x<sub>3</sub></code>
172172
- <code>y = (1−t)<sup>2</sup>y<sub>1</sub> + 2(1−t)ty<sub>2</sub> + t<sup>2</sup>y<sub>3</sub></code>
173173

174-
Instead of <code>x<sub>1</sub>, y<sub>1</sub>, x<sub>2</sub>, y<sub>2</sub>, x<sub>3</sub>, y<sub>3</sub></code> we should put coordinates of 3 control points, and then as `t` moves from `0` to `1`, for each value of `t` we'll have `(x,y)` of the curve.
174+
<code>x<sub>1</sub>, y<sub>1</sub>, x<sub>2</sub>, y<sub>2</sub>, x<sub>3</sub>, y<sub>3</sub></code> yerine 3 kontol noktasının koordinatlarını koymalıyız, sonrasında `t`, `0`'dan `1`'e gittikçe, `t`'nin her bir değeri için `(x,y)` değerlerini elde ederiz.
175175

176-
For instance, if control points are `(0,0)`, `(0.5, 1)` and `(1, 0)`, the equations become:
176+
Örneğin, kontrol noktaları `(0,0)`, `(0.5, 1)` ve `(1, 0)` ise, denklemler şöyle olur:
177177

178178
- <code>x = (1−t)<sup>2</sup> * 0 + 2(1−t)t * 0.5 + t<sup>2</sup> * 1 = (1-t)t + t<sup>2</sup> = t</code>
179179
- <code>y = (1−t)<sup>2</sup> * 0 + 2(1−t)t * 1 + t<sup>2</sup> * 0 = 2(1-t)t = –t<sup>2</sup> + 2t</code>
180180

181-
Now as `t` runs from `0` to `1`, the set of values `(x,y)` for each `t` forms the curve for such control points.
181+
Şimdi `t`, `0`'dan `1`'e gittikçe, her `t` için `(x,y)` değerleri kümesi bu kontrol noktaları için eğriyi oluşturur.
182182

183-
## Summary
183+
## Özet
184184

185-
Bezier curves are defined by their control points.
185+
Bezier eğrileri kontrol noktaları ile tanımlanır.
186186

187-
We saw two definitions of Bezier curves:
187+
Bezier eğrilerinin iki tanımını gördük:
188188

189-
1. Using a drawing process: De Casteljau's algorithm.
190-
2. Using a mathematical formulas.
189+
1. Bir çizim işlemi kullanmak: De Casteljau's algoritması.
190+
2. Matematiksel formüller kullanmak.
191191

192-
Good properties of Bezier curves:
192+
Bezier eğrilerinin iyi özellikleri:
193193

194-
- We can draw smooth lines with a mouse by moving control points.
195-
- Complex shapes can be made of several Bezier curves.
194+
- Kontrol noktalarını fare ile hareket ettirerek düzgün eğriler çizebiliriz.
195+
- Karmaşık şekilleri birkaç Bezier eğrisi ile oluşturabiliriz.
196196

197-
Usage:
197+
Kullanım:
198198

199-
- In computer graphics, modeling, vector graphic editors. Fonts are described by Bezier curves.
200-
- In web development -- for graphics on Canvas and in the SVG format. By the way, "live" examples above are written in SVG. They are actually a single SVG document that is given different points as parameters. You can open it in a separate window and see the source: [demo.svg](demo.svg?p=0,0,1,0.5,0,0.5,1,1&animate=1).
201-
- In CSS animation to describe the path and speed of animation.
199+
- Bilgisayar grafiklerinde, modelleme ve vektör grafik editörlerinde. Yazı tipleri Bezier eğrileri ile tanımlanır.
200+
- Web geliştirmede -- Canvas ve SVG formatında grafikler için. Bu arada, yukarıdaki "canlı" örnekler SVG'de yazılmıştır. Bunlar aslında parametre olarak farklı noktalar verilen tek bir SVG belgesidir. Bunu ayrı bir pencerede açabilir ve kaynağı görebilirsiniz: [demo.svg](demo.svg?p=0,0,1,0.5,0,0.5,1,1&animate=1).
201+
- CSS animasyonunda animasyonun yolunu ve hızını tanımlamak için kullanılır.

0 commit comments

Comments
 (0)