One simple method, perhaps, is to use TriAPI's "world to screen" projection of coordinates, if your "sun" is somewhere in 3D space and you're performing a traceline every few frames to determine its visibility.
That way, you'll get the 2D coords of the farthest lens flare, which can be the sun sprite itself. Then draw a series of sprites that are offset from each other, going towards a "pivot" (which is the centre of your screen). In other words, world-to-screen projection followed by multiple reflection around the screen centre.
Mistake: It's WtS instead of StW It's quite simple if we treat the pivot as position (0, 0). Let's say if WtS is (-8, 20), its reflected counterpart (let's call it R) would be (8, -20). And then you subdivide the "line" between them and put some more flares.
For example:
FlarePos1 = 0.75*WtS + 0.25*R
FlarePos2 = 0.50*WtS + 0.50*R
FlarePos3 = 0.25*WtS + 0.75*R
The other method is some trigonometry where we do this projection manually, that is, implementing a perspective projection matrix to convert some 3D coordinates into 2D. Then you do the same thing as above.
https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/building-basic-perspective-projection-matrix