/// <summary> /// Rotate about the x-axis. This involves leaving x values the same, but xOR'ing the rest. /// </summary> internal virtual HilbertCurve3D RotateAboutX() { int[] newNpoints = new int[Length()]; for (int i = 0; i < Length(); i++) { newNpoints[i] = BinaryCoordinateRotationUtils3D.RotateYZ(NpointValues[i]); } return(new HilbertCurve3D(newNpoints)); }
/// <summary> /// Rotate about the neg-x diagonal (the 100->011 diagonal). This is similar to the /// normal diagonal rotation, but with x-switched, so we XOR the x value before and after /// the rotation, and rotate in the opposite direction to specified. /// </summary> internal virtual HilbertCurve3D RotateOneThirdDiagonalNeg(bool direction) { int[] newNpoints = new int[Length()]; for (int i = 0; i < Length(); i++) { if (direction) { newNpoints[i] = BinaryCoordinateRotationUtils3D.XXOR(BinaryCoordinateRotationUtils3D.RotateNPointLeft(BinaryCoordinateRotationUtils3D.XXOR(NpointValues[i]))); } else { newNpoints[i] = BinaryCoordinateRotationUtils3D.XXOR(BinaryCoordinateRotationUtils3D.RotateNPointRight(BinaryCoordinateRotationUtils3D.XXOR(NpointValues[i]))); } } return(new HilbertCurve3D(newNpoints)); }