| 39 | {} |
| 40 | |
| 41 | void CoordinateSystem::setAxes(const Axis& vec, const Vector3d& xd) |
| 42 | { |
| 43 | if (xd.Sqr() < Base::Vector3d::epsilon()) { |
| 44 | throw Base::ValueError("Direction is null vector"); |
| 45 | } |
| 46 | Vector3d yd = vec.getDirection() % xd; |
| 47 | if (yd.Sqr() < Base::Vector3d::epsilon()) { |
| 48 | throw Base::ValueError("Direction is parallel to Z-direction"); |
| 49 | } |
| 50 | ydir = yd; |
| 51 | ydir.Normalize(); |
| 52 | xdir = ydir % vec.getDirection(); |
| 53 | xdir.Normalize(); |
| 54 | axis.setBase(vec.getBase()); |
| 55 | Base::Vector3d zdir = vec.getDirection(); |
| 56 | zdir.Normalize(); |
| 57 | axis.setDirection(zdir); |
| 58 | } |
| 59 | |
| 60 | void CoordinateSystem::setAxes(const Vector3d& n, const Vector3d& xd) |
| 61 | { |
no test coverage detected