public static MatD makeTranslationRotXY(double tx,double ty,double tz,double angleX,double angleY){
  double cosX=Math.cos(Math.toRadians(angleX));
  double sinX=Math.sin(Math.toRadians(angleX));
  double cosY=Math.cos(Math.toRadians(angleY));
  double sinY=Math.sin(Math.toRadians(angleY));
  return new MatD(new double[]{cosY,sinX * sinY,-cosX * sinY,0,0,cosX,sinX,0,sinY,-sinX * cosY,cosX * cosY,0,tx,ty,tz,1});
}

public static MatD makeTranslationRotXY ( double tx , double ty , double tz , double angleX , double angleY ) { double cosX = Math . cos ( Math . toRadians ( angleX ) ) ; double sinX = Math . sin ( Math . toRadians ( angleX ) ) ; double cosY = Math . cos ( Math . toRadians ( angleY ) ) ; double sinY = Math . sin ( Math . toRadians ( angleY ) ) ; return new MatD ( new double [ ] { cosY , sinX * sinY , - cosX * sinY , 0 , 0 , cosX , sinX , 0 , sinY , - sinX * cosY , cosX * cosY , 0 , tx , ty , tz , 1 } ) ; }
creates a matrix that is a translation followed by a rotation about the x and y axis . note , the angles are in degrees .
