Getting Proper Angle Math

Hello, I am trying to figure out some proper math, and I’m getting quite stuck.
In the image below you can see an instance of a floor bp that can have a right-angled floor using nanite meshes via alpha-cutout logic in the material:


And in this next image, you can see the alpha-cutout logic itself:

So the bp can actually do regular rectangle floors as well, which uses some different logic in the material, and the switch is handled in the bp based on if the angle provided is greater then “0”. Currently, I get get the correct angle itself no problem (in the current example using a scale of 1.7 x 5.0 I get an angle of about 18.8). I also have no issues with doing the rectangle floor. My problem comes down to having consistent float values to feed into the “CutU” variable.

One note about the whitish square in the first image is that I was using it to understand manually what the value per angled block I should expect, and then tried getting consistent math to go to those values, and hopefully and other x/y scales I use. I currently have sub-par results as you can see, but I’d like to get closer, if possible.

Thank you for any help on this matter.