public static MatrixNd createLookAt(int size, Vector3d eye, Vector3d at, Vector3d up) {
    """
	Creates a "look at" matrix for the given eye point.
	
	@param size The size of the matrix, minimum of 4
	@param eye The position of the camera
	@param at The point that the camera is looking at
	@param up The "up" vector
	@return A rotational transform that corresponds to a camera looking at the given point
    """
        if (size < 4) {
            throw new IllegalArgumentException("Minimum matrix size is 4");
        }
        final Vector3d f = at.sub(eye).normalize();
        up = up.normalize();
        final Vector3d s = f.cross(up).normalize();
        final Vector3d u = s.cross(f).normalize();
        final MatrixNd mat = new MatrixNd(size);
        mat.set(0, 0, s.getX());
        mat.set(0, 1, s.getY());
        mat.set(0, 2, s.getZ());
        mat.set(1, 0, u.getX());
        mat.set(1, 1, u.getY());
        mat.set(1, 2, u.getZ());
        mat.set(2, 0, -f.getX());
        mat.set(2, 1, -f.getY());
        mat.set(2, 2, -f.getZ());
        return mat.translate(eye.mul(-1).toVectorN());
    }
public static MatrixNd createLookAt(int size, Vector3d eye, Vector3d at, Vector3d up) {
        if (size < 4) {
            throw new IllegalArgumentException("Minimum matrix size is 4");
        }
        final Vector3d f = at.sub(eye).normalize();
        up = up.normalize();
        final Vector3d s = f.cross(up).normalize();
        final Vector3d u = s.cross(f).normalize();
        final MatrixNd mat = new MatrixNd(size);
        mat.set(0, 0, s.getX());
        mat.set(0, 1, s.getY());
        mat.set(0, 2, s.getZ());
        mat.set(1, 0, u.getX());
        mat.set(1, 1, u.getY());
        mat.set(1, 2, u.getZ());
        mat.set(2, 0, -f.getX());
        mat.set(2, 1, -f.getY());
        mat.set(2, 2, -f.getZ());
        return mat.translate(eye.mul(-1).toVectorN());
    }
public static MatrixNd createLookAt ( int size , Vector3d eye , Vector3d at , Vector3d up ) { if ( size < 4 ) { throw new IllegalArgumentException ( "Minimum matrix size is 4" ) ; } final Vector3d f = at . sub ( eye ) . normalize ( ) ; up = up . normalize ( ) ; final Vector3d s = f . cross ( up ) . normalize ( ) ; final Vector3d u = s . cross ( f ) . normalize ( ) ; final MatrixNd mat = new MatrixNd ( size ) ; mat . set ( 0 , 0 , s . getX ( ) ) ; mat . set ( 0 , 1 , s . getY ( ) ) ; mat . set ( 0 , 2 , s . getZ ( ) ) ; mat . set ( 1 , 0 , u . getX ( ) ) ; mat . set ( 1 , 1 , u . getY ( ) ) ; mat . set ( 1 , 2 , u . getZ ( ) ) ; mat . set ( 2 , 0 , - f . getX ( ) ) ; mat . set ( 2 , 1 , - f . getY ( ) ) ; mat . set ( 2 , 2 , - f . getZ ( ) ) ; return mat . translate ( eye . mul ( - 1 ) . toVectorN ( ) ) ; }
Creates a "look at" matrix for the given eye point.

@param size The size of the matrix, minimum of 4
@param eye The position of the camera
@param at The point that the camera is looking at
@param up The "up" vector
@return A rotational transform that corresponds to a camera looking at the given point
Creates a look at matrix for the given eye point .