rotateInPlace method

Sp3dObj rotateInPlace(
  1. Sp3dV3D norAxis,
  2. double radian
)

(en)Rotates all vectors of this object based on the specified axis. Unlike rotate, rotateInPlace performs the rotation around the mean coordinates of this object.

(ja)このオブジェクトの全てのベクトルを指定した軸をベースに回転させます。 rotateとは異なり、rotateInPlace はこのオブジェクトの平均座標を原点として回転が実行されます。

  • norAxis : normalized rotate axis vector.
  • radian : radian = degree * pi / 180.

Implementation

Sp3dObj rotateInPlace(Sp3dV3D norAxis, double radian) {
  final Sp3dV3D center = getCenter();
  final Sp3dV3D diff = Sp3dV3D(0, 0, 0) - center;
  move(diff);
  rotate(norAxis, radian);
  move(diff * -1);
  return this;
}