This tutorial will cover the basic notion of parametric equations, and how they apply to Roblox. Be careful with some of these scripts, they may lag your computer or cause it to freeze for a few moments or minutes.
In algebra, you may be familiar with how a function is described with y on one side of the equals sign, and x on the other. For example:
y = x y = x^2 y = x + 3
and so on.
There are other ways of describing functions, that do the exact same thing. For example, with the equation
y = x^2
we can also describe both y and x in terms of a third variable:
x = t y = t^2
This does the exact same thing as y=x^2
Similarly, this works for more complex equations such as 2-D circles, spheres, etc:
The more familiar
x^2 + y^2 = r^2 equation for a circle now becomes:
x = a*cos(t) y = a*sin(t)
In Roblox, while you are scripting, you need to define the x, y, and z coordinates for the bricks you are graphing. With parametric equations, you are given a formula for each x, y, and z coordinate. All you have to do now is just input these formulae in a way that Roblox understands, and you can make some very fancy things.
Take a look at the article on Butterfly curves on MathWorld. You can make that fancy butterfly with a very short script, because they have given you all the formulae you need.
Other curves and shapes which would have been difficult to plot before become very simple. For example, the Deltoid curve:
As you can see here, too, the Parametric equations for x and y have been changed very little. I have chosen the value for z to be 0 because it is a constant -- in other words, it doesn't change. You can change the
100 to make the entire deltoid larger or smaller -- i.e., a value of 50 makes the deltoid smaller, a value of 150 makes it larger.
There is an entire group of curves that known as Epicycloids. The image shown below uses the value of k=7.2. Here, as well, the parametric equations can be plugged directly into Roblox:
Similarly, there is a class of curves known as Hypocycloids
The above image is with the value of k=3.8. Wikipedia has several values and images on display with which to experiment.
Hypotrochoids are another example of curves that can be scripted with parametric equations. Here, the x and y formula are just as from wikipedia... and all you need to set are the values for R, r, and d (in this example the values have been provided by wikipedia!)
The Limaçon trisectrix is a special instance of the trisectrix of Pascal (also called the limaçon of Pascal). Here, again, once you get the basic formula down, you can have a wide variety of curves with different values inserted into a and b.
"A Lissajous curve is the graph of the system of parametric equations
x=A*sin(at+δ), y=B*sin(bt) which describes complex harmonic motion."
Ever wanted to know how to make a tornado like the tornado hat?
You can alter the number of loops by altering the a value.