| 33 | point3d N = (B-A)*(C-A); double D = A%N; |
| 34 | return ((*this)%N - D)/N.length(); } |
| 35 | point3d normalize(double k = 1) const { |
| 36 | // length() must not return 0 |
| 37 | return (*this) * (k / length()); } |
| 38 | point3d getProjection(P(A), P(B)) const { |
| 39 | point3d v = B - A; |
| 40 | return A + v.normalize((v % (*this - A)) / v.length()); } |
no outgoing calls