// Radius is the hypotenuse, so we have to use c² = a² + b² => a² = c² - b²
double perpendicularLength = sqrt((c->radius[0] * c->radius[0]) - (distance * distance));
- // Now, find the points using the length, then check to see if they are on
- // the line segment
+ // Now, find the intersection points using the length...
Vector lineUnit = Vector(l->p[0], l->p[1]).Unit();
Point i1 = p + (lineUnit * perpendicularLength);
Point i2 = p - (lineUnit * perpendicularLength);
- // Now we have our intersection points, next we need to see if they are on
- // the line segment...
+ // Next we need to see if they are on the line segment...
double u = ParameterOfLineAndPoint(l->p[0], l->p[1], i1);
double v = ParameterOfLineAndPoint(l->p[0], l->p[1], i2);
return Point(0, 0);
}
+
+/*
+How to find the tangent of a point off a circle:
+
+ • Calculate the midpoint on the point and the center of the circle
+ • Get the length of the line segment from the and the center divided by two
+ • Use that length to construct a circle with the point at the center and the
+ radius equal to that length
+ • The intersection of the two circles are the tangent points
+
+*/
+