Sometimes A can be below line BC and sometimes above -> so sometimes rotate clockwise and sometimes counterclockwise. Angle ABC = 90 degrees.
vectors:
A{x,y}
B{x,y}
C{x,y}
are known
need calculate vector / line
A'{x,y} / BA'
here is bisector by 45degrees but idk what about x and y (or maybe all is bad? source: https://stackoverflow.com/a/6563044/9187461 - but there is angle between vectors not lines idk):
local ux = A.x - B.x
local uy = A.y - B.y
local vx = C.x - B.x
local vy = C.y - B.y
local theta_u = math.atan2(ux, uy)
local theta_v = math.atan2(vx, vy)
local theta = (theta_u+theta_v)/2 --bisector
theta = theta * math.pi / 180
local x = math.cos(theta) * (x2?-x1?) - math.sin(theta) * (y2?-y1?) + x1?
local y = math.sin(theta) * (x2?-x1?) + math.cos(theta) * (y2?-y1?) + y1?