Ответ: Радиус среза круга
И еще в конце корень надо было вычислить)
private static float distance(Vector2f dir, float a, float b) {
float c = dir.y / dir.x;
float x = (float) ((a * b) / Math.sqrt(b * b + c * c * a * a));
float y = c * x;
return (float)Math.sqrt( x * x + y * y );
}
только надо как-то когда dir.y == 0 учесть.
|