7 #ifndef __geometry_PointCylinderNearest_h__ 8 #define __geometry_PointCylinderNearest_h__ 35 const T length=magnitude(axis);
36 const Vector<3,T> unitAxis=axis*(length>T(0)? T(1)/length: T(1));
38 along=dot(towards,unitAxis);
41 feLog(
"\nbase %s axis %s radius %.6G\n",
42 c_print(base),c_print(axis),radius);
43 feLog(
"origin: %s\n",c_print(origin));
45 feLog(
"along: %.6G/%.6G\n",along,length);
50 const T radial_mag=magnitude(radial);
53 radial*=radius/radial_mag;
66 intersection=center+radial;
67 direction=intersection-origin;
68 T mag=magnitude(direction);
75 feLog(
"intersection: %s\n",c_print(intersection));
76 feLog(
"direction: %s\n",c_print(direction));
kernel
Definition: namespace.dox:3
Find point nearest to a cylindrical solid.
Definition: PointCylinderNearest.h:21