template<typename TIterator, typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
struct DGtal::FrechetShortcut< TIterator, TInteger >::Tools
Definition at line 355 of file FrechetShortcut.h.
template<typename TIterator, typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
int DGtal::FrechetShortcut< TIterator, TInteger >::Tools::circleTangentPoints |
( |
double | x, |
|
|
double | y, |
|
|
double | x1, |
|
|
double | y1, |
|
|
double | r1, |
|
|
double * | xi, |
|
|
double * | yi, |
|
|
double * | xi_prime, |
|
|
double * | yi_prime ) |
|
inlinestatic |
Given a point X and a circle of center X1, compute the two points Xi and Xi' of the circle the tangent of which go through X. Since the triangle XXiX1 is a right triangle on Xi, the middle point M between X and X1 is equidistant to X, X1 and Xi. Thus, Xi belongs to the intersection of the circle (X1,r1) and the circle of center M and radius ||XX1||/2.
- Parameters
-
[in] | x | the first coordinate of X. |
[in] | y | the second coordinate of X. |
[in] | x1 | the first coordinate of the circle center X1. |
[in] | y1 | the second coordinate of the circle center X1. |
[in] | r1 | the circle radius. |
[out] | xi | pointer to the first coordinate of the first intersection point. |
[out] | yi | pointer to the second coordinate of the first intersection point. |
[out] | xi_prime | pointer to the first coordinate of the second intersection point. |
[out] | yi_prime | pointer to the second coordinate of the second intersection point. |
- Returns
- result of the call to circle_circle_intersection
Definition at line 516 of file FrechetShortcut.h.
518 {
519 double x0 = (
x+
x1)/2;
520 double y0 = (
y+
y1)/2;
522
525
526
528
529 }
References circle_circle_intersection().