Package javax.vecmath

Examples of javax.vecmath.Vector2d.normalize()


   
    public void visit(WedgeLineElement wedge) {
        // make the vector normal to the wedge axis
        Vector2d normal =
            new Vector2d(wedge.firstPointY - wedge.secondPointY, wedge.secondPointX - wedge.firstPointX);
        normal.normalize();
        normal.scale(rendererModel.getWedgeWidth() / rendererModel.getScale())
       
        // make the triangle corners
        Point2d vertexA = new Point2d(wedge.firstPointX, wedge.firstPointY);
        Point2d vertexB = new Point2d(wedge.secondPointX, wedge.secondPointY);
View Full Code Here


    double w1[] = invTransformPoint (p1[0], p1[1]);
    double w2[] = invTransformPoint (p2[0], p2[1]);
        // make the vector normal to the wedge axis
        Vector2d normal =
            new Vector2d(w1[1] - w2[1], w2[0] - w1[0]);
        normal.normalize();
        normal.scale(rendererModel.getWedgeWidth() / rendererModel.getScale())
       
        // make the triangle corners
        Point2d vertexA = new Point2d(w1[0], w1[1]);
        Point2d vertexB = new Point2d(w2[0], w2[1]);
View Full Code Here

    }
   
    static Vector2d newUnitVector(Point2d a, Point2d b) {
        Vector2d v = new Vector2d(b.x - a.x,
                                  b.y - a.y);
        v.normalize();
        return v;
    }
   
    IAtomContainer cloneReactionParticipant(IAtomContainer org) {
        try {
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.