To give some background: I take VCE Software Development. In VCE Software Development, we have to do some sorting algorithms – particularly Selection Sort and Quick Sort. I went beyond that. Last year, I completed all the programming practice, concepts & tasks we needed to do in programming *this year* (even though I still have to do the stuff this year as well). Last year (and you may find this on my GitHub), I wrote a program to “benchmark” sorting and searching algorithms. Because of my preference of C# as a language, and the fact our class must use VB.NET, the project is split between the two languages. The majority of the project is written in VB.NET, including the sorting algorithms. This year, I decided to extend sorting a little bit.

I wrote a program that effectively pre-computes all the values for the Bézier curves, and renders them on animations based on each sorting algorithm. The result is… pretty awesome.

You may see a full start-to-finish demonstration below:

I’ll provide the code for this program on my GitHub fairly soon.

This project was a little more to do with programming, rather than experimenting with the maths side of things. Because I already knew the formula for each curve, I could just render each without too much trouble. The issue, with this, however, was getting the speed to be fast enough to be well… worth watching.

Thanks everyone! If you liked this post please let me know, and share it with your friends. Got a question? Feel free to send a message! I’ll get back to you ASAP.

]]>Bézier Curves are pretty cool. Say you want to take a series of points and then graph a curve based on them – you can do that. Want to add weight to a point to alter a curve with the same points? You can do that.

Bézier Curves aren’t traditional polynomials, they’re parametric curves (which you can read up on here if you really want to). Essentially, the created Bézier function expresses the coordinates of each point on the curve, but not as a function of x. (In this case, a function of t).

I don’t claim to know the history behind the mathematics of Bézier curves and whatnot (or how it works, exactly!). What I do know, however, is how to implement the general case formula in a language I know and love – C#. So my primary aim after learning the formula is to implement it in C#.

My understanding of the Bézier Curve is fairly limited, in all honesty. However – I’ve given myself a day or so to play with the curve and it’s been really, really fun. In fact it’s been so fun, that I found that a Wikipedia article (surprise?) had a mistake in a formula on the page.

Supposedly, the applications of Bézier curves lie largely in digital design, which isn’t a surprise. Creating a curve from points without knowing any form of equation is handy in general… and it’s pretty cool too. I don’t know how I’ll take this forward, but it’s been really fun to learn about it.

The Bézier Curve equation looks like this (but believe me, it’s not as hard as it looks!):

You can find an example here: https://www.desmos.com/calculator/kbbdqtd1ve.

Where P_{i} is the point coordinate (x or y). So for example, given points (0, 10), (5, 0) and (10, 10), P_{0} is 0 and also 10, because x and y coordinates are used in separate equations. t is a value between 0 and 1 inclusively (i.e. an arbitrary value like 0.001). The smaller the frequency of numbers when graphing, the more detail is given.

I’m not particularly good at explaining this stuff. If you would like to have some nice reading and try it yourself, I suggest you read the following:

https://en.wikipedia.org/wiki/Binomial_coefficient

https://en.wikipedia.org/wiki/Bézier_curve https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/NURBS/RB.html