I actually just used math.cos/sine to rotate a 2D vector for my wall builder.
The post and code is here: Wall Builder | Smoothening Algorithm - #2 by MrNicNac
The red vector is the direction to the next blue square. Then, using math.cos/math.sine, I rotated the vector on the XZ plane 45 degrees (yellow vectors)