Examples of multiply()


Examples of ptolemy.math.Fraction.multiply()

        // Use entrySet here for performance reasons.
        for (Iterator actorMapEntries = entityToFiringsPerIteration.entrySet()
                .iterator(); actorMapEntries.hasNext();) {
            Map.Entry actors = (Map.Entry) actorMapEntries.next();
            Fraction repetitions = (Fraction) actors.getValue();
            repetitions = repetitions.multiply(lcmFraction);

            // FIXME: Doing the conversion to Integer here is bizarre,
            // since they are integers coming in.
            actors.setValue(Integer.valueOf(repetitions.getNumerator()));
        }
View Full Code Here

Examples of sk.fiit.jim.math.Vector3D.multiply()

  @Test
  public void basicOperations(){
    Vector3D one = cartesian(1, 1, 1);
    assertThat(one.add(cartesian(0, 0, 0)), is(equalTo(one)));
    assertThat(one.add(cartesian(1, 0, 0)), is(equalTo(cartesian(2, 1, 1))));
    assertThat(one.multiply(5.0), is(cartesian(5, 5, 5)));
    assertThat(one.divide(0.2), is(equalTo(cartesian(5, 5, 5))));
    assertThat(one.subtract(cartesian(0, 1, 0)), is(equalTo(cartesian(1, 0, 1))));
    assertThat(one.negate(), is(equalTo(cartesian(-1, -1, -1))));
    assertThat(one.addX(1.0), is(equalTo(cartesian(2, 1, 1))));
    assertThat(one.addY(-1.0), is(equalTo(cartesian(1, 0, 1))));
View Full Code Here

Examples of thaumcraft.codechicken.lib.vec.Vector3.multiply()

      Vector3 movementVec = new Vector3(motionX, motionY, motionZ);
      ForgeDirection dir = ForgeDirection.getOrientation(movingobjectposition.sideHit);
      Vector3 normalVector = new Vector3(dir.offsetX, dir.offsetY, dir.offsetZ).normalize();

      movementVector = normalVector.multiply(-2 * movementVec.dotProduct(normalVector)).add(movementVec);

      motionX = movementVector.x;
      motionY = movementVector.y;
      motionZ = movementVector.z;
    }
View Full Code Here

Examples of vazkii.botania.common.core.helper.Vector3.multiply()

        newpoints[0] = segment.startpoint;
        newpoints[splits] = segment.endpoint;

        for(int i = 1; i < splits; i++) {
          Vector3 randoff = segment.diff.copy().perpendicular().normalize().rotate(rand.nextFloat() * 360, segment.diff);
          randoff.multiply((rand.nextFloat() - 0.5F) * amount * 2);

          Vector3 basepoint = startpoint.copy().add(subsegment.copy().multiply(i));

          newpoints[i] = new BoltPoint(basepoint, randoff);
        }
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.