Examples of Angle


Examples of chunmap.model.elem.Angle

            {
                p0 = p;
            }
            else
            {
                Angle a = new Angle(p0, point, p);
                arf += a.computeAngle();

                p0 = p;
            }
        }
        if (Math.abs(arf) > 6.28) return true;
View Full Code Here

Examples of chunmap.model.elem.Angle

    static public boolean clockwise(CoordinateSeq points)
    {
        int i2 = maxPoint(points);
        int i1 = (i2 == 0) ? points.size() - 1 : i2 - 1;
        int i3 = (i2 == (points.size() - 1)) ? 0 : i2 + 1;
        Angle angle = new Angle(points.getCoordinate(i1)
            , points.getCoordinate(i2), points.getCoordinate(i3));

        int i = angle.clockwise();
        if (i == 1)
            return false;
        else if (i == -1)
            return true;
        else
View Full Code Here

Examples of cranks.geom.Angle

    links[1].connectTo(links[0]);
    links[2].connectTo(links[1]);
    links[3].connectTo(links[2]);
    links[0].connectTo(links[3]);
    fixed = 0;
    inputAngle = new Angle();
    increment = new Angle(Math.PI/180); //Dummy value
    animationDelay = 0;
    ternaryTrace = new Vector<Point>();
    initialize();
    elbowUp = true;
    drawTrace = false;
View Full Code Here

Examples of cranks.geom.Angle

  private void updateChainProperties() {
    if (isMechanism()) {
      setExtremes();
      setGrashof();
      setJointRanges();
      inputAngle.setAngle(rotationRange.getStart().add(new Angle(Math.PI/180)));
      double l1 = getLink(1).getLength();
      double l2 = getLink(2).getLength();
      double l3 = getLink(3).getLength();
      double l4 = getLink(4).getLength();
      getLink(1).getPostJoint().setCoordinates(-(l1/2), 0);
View Full Code Here

Examples of cranks.geom.Angle

  private Angle start;
  private Angle end;

  public Range() {
    start = new Angle();
    end = new Angle();
  }
View Full Code Here

Examples of cranks.geom.Angle

  public Link(double Length) {
    number = -1;
    length = Length;
    ternary = false;
    ternaryLength = 0;
    ternaryAngle = new Angle();
  }
View Full Code Here

Examples of cranks.geom.Angle

    return ternaryAngle;
  }

  public Point getCouplerPoint() {
    if (ternary) {
      Angle slopeOfLink = (new Line(preJoint, postJoint)).getSlope();
      return (new Line(getPreviousJoint(), slopeOfLink.add(ternaryAngle),
                        ternaryLength)).getEnd();
    }
    else
      return null;
  }
View Full Code Here

Examples of cranks.geom.Angle

      Object obj1 = step.getInputs()[1];
      Object obj2 = step.getInputs()[2];
      boolean lengthReference = (obj1 instanceof GeometricalObject);
      boolean slopeReference = (obj2 instanceof GeometricalObject);
      double length;
      Angle slope;
      if (lengthReference) {
        if (step.getInputs()[1] instanceof Line)
          length = ((Line)obj1).getLength();
        else
          length = ((Circle)obj1).getRadius();
      }
      else {
        length = ((Double)obj1).doubleValue();
        if (!(Math.abs(length) > 0)) {
          JOptionPane.showMessageDialog(this, "Please enter non-zero value for Length",
                    "Try Again", JOptionPane.ERROR_MESSAGE);
          initDialog();
        }
      }
      if (slopeReference)
        slope = new Angle(((Line)obj2).getSlope().getAngle());
      else {
        double slopeDegrees = ((Double)obj2).doubleValue();
        slope = new Angle(Math.toRadians(slopeDegrees));
      }
      Line newLine = new Line(p, slope, length);
      newLine.addToObjects(objects);
      if (lengthReference)
        if (obj1 instanceof Line) {
View Full Code Here

Examples of cranks.geom.Angle

  public void redoConstruction(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];
      o.move(translation, rotation, fixedPoint);
    }
    else
      System.err.println("Bad construction type");
View Full Code Here

Examples of cranks.geom.Angle

      linkLengths[0] = Double.parseDouble(tfLink1.getText());
      linkLengths[1] = Double.parseDouble(tfLink2.getText());
      linkLengths[2] = Double.parseDouble(tfLink3.getText());
      linkLengths[3] = Double.parseDouble(tfLink4.getText());
      double ternaryLength = 0;
      Angle ternaryAngle = new Angle();
      if (rbTernary.isSelected()) {
        ternaryLength = Double.parseDouble(tfTernaryLength.getText());
        if (ternaryLength <= 0) {
          JOptionPane.showMessageDialog(this, "Please enter positive value " +
                "for length", "Try Again", JOptionPane.ERROR_MESSAGE);
          return;
        }
        ternaryAngle = new Angle(Math.toRadians(Double.parseDouble(
                                     tfTernaryAngle.getText())));
      }
      for (int i = 0; i<4; i++)
        if (linkLengths[i] <= 0) {
          JOptionPane.showMessageDialog(this, "Please enter positive value " +
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.