code: public Matrix3f rotateX(float ang, Matrix3f dest) {
          float sin, cos;
          if (ang == (float) Math.PI || ang == -(float) Math.PI) {
              cos = -1.0f;
              sin = 0.0f;
          } else if (ang == (float) Math.PI * 0.5f || ang == -(float) Math.PI * 1.5f) {
              cos = 0.0f;
              sin = 1.0f;
          } else if (ang == (float) -Math.PI * 0.5f || ang == (float) Math.PI * 1.5f) {
              cos = 0.0f;
              sin = -1.0f;
          } else {
              sin = (float) Math.sin(ang);
              cos = (float) Math.cosFromSin(sin, ang);
          }
          float rm11 = cos;
          float rm21 = -sin;
          float rm12 = sin;
          float rm22 = cos;
  
          // add temporaries for dependent values
          float nm10 = m10 * rm11 + m20 * rm12;
          float nm11 = m11 * rm11 + m21 * rm12;
          float nm12 = m12 * rm11 + m22 * rm12;
          // set non-dependent values directly
          dest.m20 = m10 * rm21 + m20 * rm22;
          dest.m21 = m11 * rm21 + m21 * rm22;
          dest.m22 = m12 * rm21 + m22 * rm22;
          // set other values
          dest.m10 = nm10;
          dest.m11 = nm11;
          dest.m12 = nm12;
          dest.m00 = m00;
          dest.m01 = m01;
          dest.m02 = m02;
  
          return dest;
      }
docs: /* (non-Javadoc)
  @see org.joml.Matrix3fc#rotateX(float, org.joml.Matrix3f)