update:
This commit is contained in:
@@ -32,8 +32,8 @@ namespace TMI_practicum
|
||||
double px = X + a * (c1.X - X) / d;
|
||||
double py = Y + a * (c1.Y - Y) / d;
|
||||
|
||||
double htemp = Math.Round(R * R - a * a, 15);
|
||||
if (htemp == 0)
|
||||
double htemp = R * R - a * a;
|
||||
if (Math.Round(htemp, 15) == 0)
|
||||
{
|
||||
intersections = new Intersection[1];
|
||||
intersections[0] = new Intersection(Math.Round(px, 15), Math.Round(py, 15));
|
||||
@@ -41,7 +41,7 @@ namespace TMI_practicum
|
||||
else
|
||||
{
|
||||
intersections = new Intersection[2];
|
||||
double h = Math.Round(Math.Sqrt(htemp), 15);
|
||||
double h = Math.Sqrt(htemp);
|
||||
intersections[0] = new Intersection(Math.Round(px + h * (c1.Y - Y) / d, 15), Math.Round(py - h * (c1.X - X) / d, 15));
|
||||
intersections[1] = new Intersection(Math.Round(px - h * (c1.Y - Y) / d, 15), Math.Round(py + h * (c1.X - X) / d, 15));
|
||||
}
|
||||
|
Reference in New Issue
Block a user