Beispiel #1
0
  public GRotation(String axis, double angle) {
    this();
    double ca = Math.cos(angle);
    double sa = Math.sin(angle);

    if (axis.equals(Z_AXIS)) {
      mtx[0][0] = ca;
      mtx[0][1] = -sa;
      mtx[1][0] = sa;
      mtx[1][1] = ca;

    } else if (axis.equals(Y_AXIS)) {
      mtx[0][0] = ca;
      mtx[0][2] = -sa;
      mtx[2][0] = sa;
      mtx[2][2] = ca;

      /*
               mtx[0][0] = sa;
               mtx[0][2] = ca;
               mtx[2][0] = ca;
               mtx[2][2] = -sa;
      */

    } else {
      E.error("unknown axis " + axis);
    }
  }
 public void setFunctions(ArrayList<Function> ctfa) {
   if (funcs != null) {
     E.error("overwriting functions?");
   }
   funcs = ctfa;
 }