I am working on a project in javascript and p5.js and am stuck at this point. I have to rotate a line from one of its ends with a certain angle in Radians/Degrees. Here's what I want to get-the image
Sorry for my bad drawing. So I want a formula to get C(x,y) to use in my code.
What should be the values of x and y in terms of t-ratios and x1,y1,x2,y2
Sorry,flip the positions of A and B.


A \theta counterclockwise rotation matrix about the origin takes an (x,y) input and gives an output $(x cos \theta - y sin \theta, x sin \theta + y cos \theta) $. So you can shift your angle vertex to the origin, perform the rotation, and then shift back; if A is the vertex with coordinates (x1,y1) then subtract that from B, transform, and then add A back on to get C(x,y).