I have two vectors CA and CB which I 'stroked' with lines of width a and b. I need to calculate D and E points to draw miter joint between two stroked vectors. What I know is:
- A point coordinates
- B point coordinates
- C point coordinates
- β angle
- a length
- b length
What I'm looking are coordinates of points D and E. I need to find universal formula that lets me to calculate those points at any β. (please see pic.1 below)
I can calculate those points if use stroke with same length for both vectors (a == b). I'm doing it by reflecting point C over vector AC with distance 0.5*a. Then I have right angle triangle, on which γ angle at point C equals 90° - (0.5 * β) angle. Therefore I have all three angles for the triangle and length of CF (half of a) which lets my to calculate coordinates of point D. (please see pic.2 below). I use triangle CGE to calculate E coordinates in the same way as above.
My problems start when I need to use different width for the vector's stroke (a != b) (please see pic.3 below). In that case when I draw CFD triangle I cannot calculate γ angle as it is not 90° - (0.5 * β) anymore and I have no idea how to calculate D and E coordinates. Can someone point me in the right direction how to find γ angle or if there is any other (better) way to calculate coordinates of D and E?