Rotating a gradient

BlitzPlus Forums/BlitzPlus Programming/Rotating a gradient

Mr Brine(Posted 2003) [#1]
Howdy Blitzers!

Does anyone know how to rotate a gradient? where xg# and yg# contain the value of the gradient (-1 to 1)

Thanks

Mr Brine


jfk EO-11110(Posted 2003) [#2]
In the code Archive there is a Source to freely position the 4 Corner Points of an image, so you could rotate them around the center...


MutteringGoblin(Posted 2003) [#3]
This might work.

xr# = (xg# * Cos(a#)) - (yg# * Sin(a#))
xr# = (yg# * Cos(a#)) + (xg# * Sin(a#))


Where a# is the angle of rotation.

I'm not very good at trigonometry but that's apparently the formula to rotate a point, and I'm guessing a point is the same as a gradient.