| 39 | point3d v = B - A; |
| 40 | return A + v.normalize((v % (*this - A)) / v.length()); } |
| 41 | point3d rotate(P(normal)) const { |
| 42 | //normal must have length 1 and be orthogonal to the vector |
| 43 | return (*this) * normal; } |
| 44 | point3d rotate(double alpha, P(normal)) const { |
| 45 | return (*this) * cos(alpha) + rotate(normal) * sin(alpha);} |
| 46 | point3d rotatePoint(P(O), P(axe), double alpha) const{ |