Package cranks.geom

Examples of cranks.geom.Angle


  }

  private Angle getAngle(Line line1, Line line2) {
    double angleBetweenLines = line1.getSlope().sub(line2.getSlope()).getAngle();
    angleBetweenLines = Math.abs(angleBetweenLines - Math.PI);
    return new Angle(angleBetweenLines);
  }
View Full Code Here


  }

  public void updateSettings() {
    int angularIncrement = ((Integer)ftfAngularIncrement.getValue()).intValue();
    mechanism.setAnimationDelay(sAnimationDelay.getValue());
    mechanism.setIncrement(new Angle(Math.toRadians(angularIncrement)));
    if (oldAngularIncrement != angularIncrement)
      mechanism.initialize();
    oldAngularIncrement = angularIncrement;
    int zoom = ((Integer)ftfZoom.getValue()).intValue();
    mfInstance.setZoom((double)zoom/100);
View Full Code Here

  public void doConstruction(ConstructionStep step) {
    if (step.getConstructionType() == MOVE) {
      GeometricalObject o = (GeometricalObject)step.getInputs()[0];
      Point translation = new Point(((Double)step.getInputs()[1]).doubleValue(),
                                    ((Double)step.getInputs()[2]).doubleValue());
      Angle rotation = new Angle(((Double)step.getInputs()[3]).doubleValue());
      Point fixedPoint = (Point)step.getInputs()[4];
      if (fixedPoint.getAssocObjects().contains(o)) {
        fixedPoint = new Point(fixedPoint.getX(), fixedPoint.getY());
        fixedPoint.move(translation, new Angle(0), new Point());
        step.getInputs()[4] = fixedPoint;
      }
      o.move(translation, rotation, fixedPoint);
      clearAndHide();
      step.setOutputs(new Object[]{o});
View Full Code Here

  public void undoConstruction(ConstructionStep step) {
    if (step.getConstructionType() == MOVE) {
      GeometricalObject o = (GeometricalObject)step.getInputs()[0];
      Point translation = new Point(((Double)step.getInputs()[1]).doubleValue(),
                                    ((Double)step.getInputs()[2]).doubleValue());
      Angle rotation = new Angle(((Double)step.getInputs()[3]).doubleValue());
      Point fixedPoint = (Point)step.getInputs()[4];
      rotation = rotation.mul(-1);
      translation = new Point(translation.getX()*(-1), translation.getY()*(-1));
      o.move(new Point(), rotation, fixedPoint);
      o.move(translation, new Angle(0), fixedPoint);
    }
    else
      System.err.println("Bad construction type");
  }
View Full Code Here

TOP

Related Classes of cranks.geom.Angle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.