Maya Expression Question (Beginner question)


#1

Hi,
I just got into expression, and i got these two expressions from my teacher,

First one,

2 plane > soft body
vector $a = inputGeometryPoints;
vector $b = inputGeometryPoints;
vector $l = <<locator1.tx, locator1.ty, locator1.tz>>;
float $w = smoothstep( 0,1, mag($a-$l));
position = ($a-$b)*$w + $b;

and it can use the locator to make the plane bumping,

Second one,
vector $l = <<locator1.tx, locator1.ty, locator1.tz>>;
vector $p = position;
rgbPP = <<1,1,1>>*pow(linstep(-1,1, dot(unit($l),unit($p))), 3);

it can change the ball’s color through the locator’s position

but i just don’t those expression from the each bottom line are working in Maya(3d software)…
i understand how each function works, and definition, and i know the basic variable, assign.
But the longest one, i just can’t figure out…
i roughly know it’s about the calculation of vector in 3d software
Is there any way to practice expression, more advanced, those sources on youtube are just tooooo basic, and i can’t find these sort of online courses either.
(btw, the classes i’m now taking has finished(the expression part), time was so short so that my teacher couldn’t spend too much time helping us out, he was just telling us some shallow knowledge and dropped these expression to us…)
Thanks!