Calculates AoMatrix for a vertex based on the vertex position and the face it belongs. Only works for regular N/S/E/W/T/B faces

@param offset the offset
@return the matrix
497679
public int[][] getAoMatrix(EnumFacing offset)
	{
		int[][] a = new int[3][3];

		if (offset == EnumFacing.WEST || offset == EnumFacing.EAST)
		{
			a[0][0] = a[1][0] = a[2][0] = offset.getFrontOffsetX();
			a[1][1] += Math.round(y * 2 - 1); // -1 if 0, 1 if 1;
			a[2][1] += Math.round(y * 2 - 1); // -1 if 0, 1 if 1;
			a[0][2] += Math.round(z * 2 - 1); // -1 if 0, 1 if 1;
			a[1][2] += Math.round(z * 2 - 1); // -1 if 0, 1 if 1;
		}
		else if (offset == EnumFacing.UP || offset == EnumFacing.DOWN)
		{
			a[0][1] = a[1][1] = a[2][1] = offset.getFrontOffsetY();
			a[1][0] += Math.round(x * 2 - 1); // -1 if 0, 1 if 1;
			a[2][0] += Math.round(x * 2 - 1); // -1 if 0, 1 if 1;
			a[0][2] += Math.round(z * 2 - 1); // -1 if 0, 1 if 1;
			a[1][2] += Math.round(z * 2 - 1); // -1 if 0, 1 if 1;
		}
		else if (offset == EnumFacing.NORTH || offset == EnumFacing.SOUTH)
		{
			a[0][2] = a[1][2] = a[2][2] = offset.getFrontOffsetZ();
			a[1][0] += Math.round(x * 2 - 1); // -1 if 0, 1 if 1;
			a[2][0] += Math.round(x * 2 - 1); // -1 if 0, 1 if 1;
			a[0][1] += Math.round(y * 2 - 1); // -1 if 0, 1 if 1;
			a[1][1] += Math.round(y * 2 - 1); // -1 if 0, 1 if 1;
		}

		return a;
	}
1110855
public Matrix3 setToRotation (float angle) {
        float sina = FloatMath.sin(angle), cosa = FloatMath.cos(angle);
        return set(cosa, -sina, 0f,
                   sina, cosa, 0f,
                   0f, 0f, 1f);
    }
738719
function(matrix) {
    this.vertices = this.vertices.map(function(v) {
      return matrix.transformPoint(Vector.fromArray(v)).toArray();
    });
    if (this.normals) {
      var invTrans = matrix.inverse().transpose();
      this.normals = this.normals.map(function(n) {
        return invTrans.transformVector(Vector.fromArray(n)).unit().toArray();
      });
    }
    this.compile();
    return this;
  }
1105523
public void applyMatrix()
	{
		transformMatrix.translate(new Vector3f(-0.5F, -0.5F, -0.5F));

		for (Vertex v : vertexes)
			v.applyMatrix(transformMatrix);

		resetMatrix();

		return;
	}
1105729
public Vector3D getVertex(int index) {
        tmpV.setX(cornerX.get(index));
        tmpV.setY(cornerY.get(index));
        tmpV.setZ(cornerZ.get(index));
        calcG();
        return tmpV;
    }
937483
private Matrix getThisSideMatrix(Matrix B)
    {
        if(this.canBeMutated())
            return this.clone();
        else//so far, only other option in JSAT is a dense matrix
        {
            DenseMatrix dm = new DenseMatrix(rows(), cols());
            dm.mutableAdd(this);
            return dm;
        }
    }
870897
public static double[][] getMatrix(final double[][] m1, final int r0, final int r1, final int c0, final int c1) {
    assert r0 <= r1 && c0 <= c1 : ERR_INVALID_RANGE;
    assert r1 <= m1.length && c1 <= m1[0].length : ERR_MATRIX_DIMENSIONS;
    final int rowdim = r1 - r0, coldim = c1 - c0;
    final double[][] X = new double[rowdim][coldim];
    for(int i = r0; i < r1; i++) {
      System.arraycopy(m1[i], c0, X[i - r0], 0, coldim);
    }
    return X;
  }
1341650
def offset(self):
        
        offset = 0
        # Now we must typecast each argument to a u16 (POINTER) type
        # i is the dimension ith index, b is the bound
        for i, b in zip(self.arglist, self.entry.bounds):
            tmp = i.children[0]
            if is_number(tmp) or is_const(tmp):
                if offset is not None:
                    offset = offset * b.count + tmp.value
            else:
                offset = None
                break

        if offset is not None:
            offset = TYPE.size(gl.SIZE_TYPE) + TYPE.size(gl.BOUND_TYPE) * len(self.arglist) + offset * self.type_.size

        return offset
495564
public FloatBuffer getAsMatrix4x3f(FloatBuffer dest) {
        MemUtil.INSTANCE.putMatrix4x3f(this, dest.position(), dest);
        return dest;
    }
1110754
private void rotatorPushRight2( int m , int offset)
    {
        double b11 = bulge;
        double b12 = diag[m+offset];

        computeRotator(b12,-b11);

        diag[m+offset] = b12*c-b11*s;

        if( m+offset<N-1) {
            double b22 = off[m+offset];
            off[m+offset] = b22*c;
            bulge = b22*s;
        }

//        SimpleMatrix Q = createQ(m,m+offset, c, s, true);
//        B=Q.mult(B);
//
//        B.print();
//        printMatrix();
//        System.out.println("  bulge = "+bulge);
//        System.out.println();

        if( Ut != null ) {
            updateRotator(Ut,m,m+offset,c,s);

//            SimpleMatrix.wrap(Ut).mult(B).mult(SimpleMatrix.wrap(Vt).transpose()).print();
//            printMatrix();
//            System.out.println("bulge = "+bulge);
//            System.out.println();
        }
    }
1329199
public Matrix4x3f reflect(Quaternionfc orientation, Vector3fc point, Matrix4x3f dest) {
        double num1 = orientation.x() + orientation.x();
        double num2 = orientation.y() + orientation.y();
        double num3 = orientation.z() + orientation.z();
        float normalX = (float) (orientation.x() * num3 + orientation.w() * num2);
        float normalY = (float) (orientation.y() * num3 - orientation.w() * num1);
        float normalZ = (float) (1.0 - (orientation.x() * num1 + orientation.y() * num2));
        return reflect(normalX, normalY, normalZ, point.x(), point.y(), point.z(), dest);
    }
1188249
public Matrix getRotationMatrix(double theta) {
		if( rotationAxis == null) {
			// special case for pure translational axes
			return Matrix.identity(3, 3);
		}
		double x = rotationAxis.getX();
		double y = rotationAxis.getY();
		double z = rotationAxis.getZ();
		double cos = Math.cos(theta);
		double sin = Math.sin(theta);
		double com = 1 - cos;
		return new Matrix(new double[][] {
				{com*x*x + cos, com*x*y+sin*z, com*x*z+-sin*y},
				{com*x*y-sin*z, com*y*y+cos, com*y*z+sin*x},
				{com*x*z+sin*y, com*y*z-sin*x, com*z*z+cos},
		});
	}
1210469
public static FloatMatrix acosi(FloatMatrix x) { 
		/*# mapfct('Math.acos') #*/
//RJPP-BEGIN------------------------------------------------------------
	   for (int i = 0; i < x.length; i++)
	      x.put(i, (float) Math.acos(x.get(i)));
	   return x;
//RJPP-END--------------------------------------------------------------
	}
54131
function () {
            var i;
            var edges = this.edges;
            var normals = this.normals;
            var indices = this.indices;

            // Copy the original points array and apply the offset/angle
            var points = this.points;
            var len = points.length;

            if (len < 3) {
                throw new Error("Requires at least 3 points");
            }

            // Calculate the edges/normals
            for (i = 0; i < len; i++) {
                if (edges[i] === undefined) {
                    edges[i] = new me.Vector2d();
                }
                edges[i].copy(points[(i + 1) % len]).sub(points[i]);

                if (normals[i] === undefined) {
                    normals[i] = new me.Vector2d();
                }
                normals[i].copy(edges[i]).perp().normalize();
            }
            // trunc array
            edges.length = len;
            normals.length = len;
            // do not do anything here, indices will be computed by
            // toIndices if array is empty upon function call
            indices.length = 0;

            return this;
        }
1276698
public static boolean isMatrix(IntBuffer shapeInfo) {
        int rank = Shape.rank(shapeInfo);
        if (rank != 2)
            return false;
        return !isVector(shapeInfo);
    }
1029866
public Matrix getMatrix(int i0, int i1, int j0, int j1)
    {
        Matrix X = new Matrix(i1 - i0 + 1, j1 - j0 + 1);
        double[][] B = X.getArray();
        try
        {
            for (int i = i0; i <= i1; i++)
            {
                for (int j = j0; j <= j1; j++)
                {
                    B[i - i0][j - j0] = A[i][j];
                }
            }
        }
        catch (ArrayIndexOutOfBoundsException e)
        {
            throw new ArrayIndexOutOfBoundsException("Submatrix indices");
        }
        return X;
    }
428899
public double[][] buildNodeMatrix(double[] nodeSequence) {
        int i, j, k;
        for (i = 0; i < nodeNumber; i++) {
            nodeMatrix[i][0] = nodeSequence[i];
            for (j = 1; j <= layerNumber; j++) {
                nodeMatrix[i][j] = 0.0;
                for (k = 0; k < nodeNumber; k++) {
                    if (apspMatrix[i][k] == j) {
                        nodeMatrix[i][j] += nodeSequence[k];
                    }
                }
            }
        }
        return nodeMatrix;
    }