//item is line can be horizontal or vertical
float dx = item.X2- item.Position.X;
float dy = item.Y2 - item.Position.Y;
float a = dx * dx + dy * dy;
float b = 2 * (dx * (item.Position.X - ball.Position.X) + dy * (item.Position.Y - ball.Position.Y));
float c = (item.Position.X - ball.Position.X) * (item.Position.X - ball.Position.X) + (item.Position.Y - ball.Position.Y) * (item.Position.Y - ball.Position.Y) - ball.Radius * ball.Radius;
float discriminant = b * b - 4 * a * c;
//item is line can be horizontal or vertical
float dx = item.X2- item.Position.X;
float dy = item.Y2 - item.Position.Y;
float a = dx * dx + dy * dy;
float b = 2 * (dx * (item.Position.X - ball.Position.X) + dy * (item.Position.Y - ball.Position.Y));
float c = (item.Position.X - ball.Position.X) * (item.Position.X - ball.Position.X) + (item.Position.Y - ball.Position.Y) * (item.Position.Y - ball.Position.Y) - ball.Radius * ball.Radius;
float discriminant = b * b - 4 * a * c;