i have a start point and a end point. I want to work out the angle i have this formula that seems to work
double dx = end.X - start.X;
double dy = end.Y - start.Y;
double degrees = Math.Acos((-Math.Pow(dy, 2) + Math.Pow(dx, 2) + Math.Pow(dx, 2)) / (2 * Math.Pow(dx, 2)));
degrees = degrees * 180 / Math.PI;
Then i want to take the angle and extend the line’s length. i have this so far
end.Y = (start.Y + (len * Math.Sin(angle)));
end.X = (start.X + (len * Math.Cos(angle)));
now this does not give me the right value.
white is original line and red is the extending

what am i doing wro
This is what I meant in code: