Implementing functions to draw:
- Lines (Using Bresenham algorithm)
- Circles (Using Bresenham algorithm)
- Bezier Curves using the following steps:
-
Receiving 4 points.
-
Create 2 seperate vectors: first vector is from the points X's and second vector is from the points Y's.
-
Multiply the vectors separately in bezier matrix to calculate a,b,c,d equation constants.
-
Calculate a new point on the curve using the following polynomials:
t values is between 0 and 1 (Taking smaller steps equals smoother bezier curve)
-
Draw a line between the previous point and the new point.
-
Increment t by the step size.
Repeate steps iv ~ vi until t >= 1
-