I am trying to calculate the (x1,y1), (x2,y2) coordinates of a line. From the image consider the rectangle of width w, height h, center c and angle θ.

If the same is given in a graph with X and Y axis then we can draw a tangent with angle θ from the center to the edge of the circle. To calculate the point using formula, I know I can use
x = cos(θ) * r
y = sin(θ) * r
Is there a formula to find the x1,x2,y1,y2?