1
0
This commit is contained in:
2019-05-21 20:50:35 +02:00
parent 168262ea7b
commit eb2e9172a9
3 changed files with 34 additions and 15 deletions

View File

@@ -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));
}