You can think of the ratio values as each coordinate's "gravity": the higher the gravity, the closer to that coordinate the curve will want to be. You'll also notice that if you simply increase or decrease all the ratios by the same amount, nothing changes... much like with gravity, if the relative strengths stay the same, nothing really changes. The values define each coordinate's influence _relative to all other points_.
### How to implement rational curves
Extending the code of the previous section to include ratios is almost trivial:
```
function RationalBezier(2,t,w[],r[]):
t2 = t * t
mt = 1-t
mt2 = mt * mt
f = [
r[0] * mt2,
2 * r[1] * mt * t,
r[2] * t2
]
basis = f[0] + f[1] + f[2]
return (f[0] * w[0] + f[1] * w[1] + f[2] * w[2])/basis
function RationalBezier(3,t,w[],r[]):
t2 = t * t
t3 = t2 * t
mt = 1-t
mt2 = mt * mt
mt3 = mt2 * mt
f = [
r[0] * mt3,
3 * r[1] * mt2 * t,
3 * r[2] * mt * t2,
r[3] * t3
]
basis = f[0] + f[1] + f[2] + f[3]
return (f[0] * w[0] + f[1] * w[1] + f[2] * w[2] + f[3] * w[3])/basis
```
And that's all we have to do.