With reference to my previous question:
I'm using micklh's answer, which works perfectly. However, it calculates the gradient based on two points, a starting point and an ending point. I want to change that such that I can give it a center point, an angle in degrees, and a length.
If you look at the picture from the other question:
You can sort of discern where the center point is, the x,y of starting/ending locations become the dots based on the length of the gradient.
I assume I would have to:
- Take the center location
- Apply the angle + length
- Gives me my ending x,y
- Take the center location
- Calculate the reverse angle
- Apply the reverse angle + length
- Gives me my starting x,y
- Plug these starting/ending positions to the answer from the other question.
Am I correct? How would I do those steps?