In the context of a game program, I have a moving circle and a fixed line segment. The segment can have an arbitrary size and orientation.
- I know the radius of the circle: r
- I know the coordinates of the circle before the move: (xC1, yC1)
- I know the coordinates of the circle after the move: (xC2, yC2)
- I know the coordinates of the extremities of the line segment: (xL1, yL1) – (xL2, yL2)

I am having difficulties trying to compute:
- A boolean: If any part of the circle hits the line segment while moving from (xC1, yC1) to (xC2, yC2)
- If the boolean is true, the coordinates (x, y) of the center of the circle when it hits the line segment (I mean when circle is tangent to segment for the first time)
Look here:
Line segment / Circle intersection
If the value you get under the square root of either the computation of x or y is negative, then the segment does not intersect. Aside from that, you can stop your computation after you have x and y (note: you may get two answers)
Update I’ve revised my answer to very specifically address your problem. I give credit to Doswa for this solution, as I pretty much followed along and wrote it for C#. The basic strategy is that we are going to locate the closest point of your line segment to the center of the circle. Based on that, we’ll look at the distance of that closest point, and if it is within the radius, locate the point along the direction to the closest point that lies right at the radius of the circle.