Examples of Angle


Examples of cranks.geom.Angle

                  (new Line(selectedSide.getStart(), newSide.getEnd()));
        Line line2 = (orientation)?
                  (new Line(selectedSide.getEnd(), newSide.getEnd())):
                  (new Line(selectedSide.getEnd(), newSide.getStart()));
        Point centreOfRotation;
        Angle angleOfRotation;
        if (line1.getLength() < Point.LEAST_COUNT) {
          centreOfRotation = new Point(line1.getStart().getX(),line1.getStart().getY());
          angleOfRotation = (new Line(centreOfRotation, line2.getEnd())).getSlope().
                    sub((new Line(centreOfRotation, line2.getStart())).getSlope());
        }
        else if (line2.getLength() < Point.LEAST_COUNT) {
          centreOfRotation = new Point(line2.getStart().getX(),line2.getStart().getY());
          angleOfRotation = (new Line(centreOfRotation, line1.getEnd())).getSlope().
                    sub((new Line(centreOfRotation, line1.getStart())).getSlope());
        }
        else {
          Line perpLine1 = new Line(line1.midPoint(),line1.getSlope().
                              add(new Angle(Math.PI/2)),1);
          Line perpLine2 = new Line(line2.midPoint(),line2.getSlope().
                              add(new Angle(Math.PI/2)),1);
          if (perpLine1.canIntersect(perpLine2)) {
            centreOfRotation = perpLine1.intersect(perpLine2)[0];
            angleOfRotation = (new Line(centreOfRotation, line1.getEnd())).getSlope().
                    sub((new Line(centreOfRotation, line1.getStart())).getSlope());
          }
          else {
            Point translation = new Point(
                      line1.getEnd().getX() - line1.getStart().getX(),
                      line1.getEnd().getY() - line1.getStart().getY());
            ptOppSelSide.move(translation, new Angle(0), new Point());
            Triangle newTriangle = new Triangle(ptOppSelSide, newSide);
            newTriangle.addToObjects(objects);
            clearAndHide();
            step.setOutputs(new Object[]{ptOppSelSide, newTriangle.getSides()[1],
                        newTriangle.getSides()[2], newTriangle});
View Full Code Here

Examples of cranks.geom.Angle

      }
    }
    String fixedLink = (String)cFixedLink.getSelectedItem();
    int fixed = Integer.parseInt(fixedLink.substring(fixedLink.length()-1));
    double ternaryLength = 0;
    Angle ternaryAngle = new Angle();
    if (rbTernary.isSelected()) {
      Triangle ternaryLink = (Triangle)cTernaryLink.getSelectedItem();
      Line link3 = (fixed > 2)?(lines[(fixed-1)-2]):(lines[(fixed-1)+2]);
      if (!(link3.getAssocObjects().contains(ternaryLink))) {
        JOptionPane.showMessageDialog(this, "Ternary link is not connected to "+
View Full Code Here

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

Examples of cranks.geom.Angle

  }

  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

Examples of cranks.geom.Angle

  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

Examples of cranks.geom.Angle

  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

Examples of freegressi.tableur.Tableur.Angle

    }

  }

  public void notifySheetsAngleChanged(Angle newAngle, boolean undoable){
    Angle oldAngle = angle;
    angle = newAngle;
    for (Tableur sheet : sheetList){
      sheet.notifyAngleChanged(newAngle);
    }
    fireSheetsAngleChanged(oldAngle, newAngle, undoable);
View Full Code Here

Examples of gov.nasa.worldwind.geom.Angle

*/
public class GfrLatLon
{
   static public LatLon s_getMiddle(LatLon llnA, LatLon llnB)
   {
      Angle angAzimuth = LatLon.greatCircleAzimuth(llnA, llnB);
      Angle angAngle = LatLon.greatCircleDistance(llnA, llnB);

      return LatLon.greatCircleEndPosition(llnA, angAzimuth, angAngle.divide(2));
   }
View Full Code Here

Examples of gov.nasa.worldwind.geom.Angle

    * @param oldPosition Previous position of shape
    * @param newPosition New position for shape
    */
   protected void moveToPosition(Position oldPosition, Position newPosition)
   {
      Angle distanceAngle = LatLon.greatCircleDistance(oldPosition, newPosition);
      Angle azimuthAngle = LatLon.greatCircleAzimuth(oldPosition, newPosition);
      measureTool.moveMeasureShape(azimuthAngle, distanceAngle);
      measureTool.firePropertyChange(GfrEditorObjShpSegWiseTool.EVENT_POSITION_REPLACE, oldPosition, newPosition);
   }
View Full Code Here

Examples of gov.nasa.worldwind.geom.Angle

   }

   protected LatLon computeControlPointLocation(String control, Globe globe, Angle heading, LatLon center,
           double width, double height)
   {
      Angle azimuth = this.computeControlPointAzimuth(control, width, height);
      Angle pathLength = this.computeControlPointPathLength(control, width, height, globe.getRadiusAt(center));

      if (control.equals(CENTER))
      {
         return center;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.