Package net.wigis.graph.dnv.utilities

Examples of net.wigis.graph.dnv.utilities.Vector2D.dotProduct()


      if( v.getProperty( "pinned" ) == null )
      {
        difference.set( v.getForce() );
        length = difference.length();
        difference.normalize();
        difference.dotProduct( Math.min( length, temperature ) );
        v.move( difference, true, false );
        // v.getPosition().setX( Math.min( width / 2.0f, Math.max(
        // -width / 2.0f, v.getPosition().getX() ) ) );
        // v.getPosition().setY( Math.min( height / 2.0f, Math.max(
        // -height / 2.0f, v.getPosition().getY() ) ) );
View Full Code Here


    for( DNVNode v : nodes )
    {
      Vector2D newPos = new Vector2D( v.getPosition() );
      newPos.subtract( center );
      newPos.normalize();
      newPos.dotProduct( radius );
      newPos.add( center );
      v.setPosition( newPos );
    }
  }
View Full Code Here

          nodeToParent.put( childNode.getId(), newNode );
          position.add( childNode.getPosition() );
          color.add( childNode.getColor() );
          childNode.setParentNode( newNode );
        }
        position.dotProduct( 1.0f / (float)tempList.size() );
        color.dotProduct( 1.0f / (float)tempList.size() );
        if( tempList.size() == 1 )
        {
          newNode.setLabel( tempList.get( 0 ).getLabel() );
          newNode.setIcon( tempList.get( 0 ).getIcon() );
View Full Code Here

    }
    else
    {
      float intensity = repelling_intensity / ( distance * distance );
      // Normalize and Multiply by the intensity
      repellingForce.dotProduct( intensity / distance );
    }

    return repellingForce;
  }

View Full Code Here

      springForce.normalize();
      float delta;
      float intensity;
      delta = distance;// - restingDistance;
      intensity = k * delta;
      springForce.dotProduct( intensity );
    }

    return springForce;
  }

View Full Code Here

    for( int i = 0; i < subNodes.size(); i++ )
    {
      newPos.add( subNodes.get( i ).getPosition() );
    }

    newPos.dotProduct( 1.0f / (float)subNodes.size() );
    setPosition( newPos );

    if( recursive && parentNode != null )
      parentNode.reposition( recursive );
View Full Code Here

      Vector2D tempVelocity[] = { new Vector2D( 0, 0 ), new Vector2D( 0, 0 ) };
      Vector2D tempPositionIncrement[] = { new Vector2D( 0, 0 ), new Vector2D( 0, 0 ) };
      Vector2D tempVector = new Vector2D();
      tempVelocity[0].set( velocity );
      tempVector.set( acceleration );
      tempVector.dotProduct( timeStep[0] );
      tempVelocity[0].add( tempVector );
      tempVector.set( tempVelocity[0] );
      tempVector.dotProduct( timeStep[0] );
      tempPositionIncrement[0].set( tempVector );
      tempPositionIncrement[0].dotProduct( timeStep[0] );
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.