Java Geometry Algorithm makeLine(Point2D.Double center, Point2D.Double north, Point2D.Double east)

Here you can find the source of makeLine(Point2D.Double center, Point2D.Double north, Point2D.Double east)

Description

Return a Shape object for the "line" symbol.

License

LGPL

Parameter

Parameter Description
center the center point in screen coords
north the north point in screen coords
east the east point in screen coords

Declaration

public static Shape makeLine(Point2D.Double center, Point2D.Double north, Point2D.Double east) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.awt.Shape;

import java.awt.geom.Line2D;
import java.awt.geom.Point2D;

public class Main {
    /**//from ww  w .  ja v a2s . com
     * Return a Shape object for the "line" symbol.
     *
     * @param center the center point in screen coords
     * @param north the north point in screen coords
     * @param east the east point in screen coords
     */
    public static Shape makeLine(Point2D.Double center, Point2D.Double north, Point2D.Double east) {

        Point2D.Double south = new Point2D.Double(center.x - (north.x - center.x), center.y - (north.y - center.y));
        Line2D.Double p = new Line2D.Double(north, south);
        return p;
    }
}

Related

  1. interpol(Point p1, Point p2, float factor)
  2. invVec(final Point2D v)
  3. lonLatToString(Point2D.Double pt)
  4. makeCircle(double xCenter, double yCenter, double r, int nPoints)
  5. makeCornerTo(GeneralPath gp, Point2D cornerPoint, Point2D nextCornerPoint, float radius)
  6. makeNeighbor(Point theHex, int direction)
  7. manhattanDistance(Point a, Point b)
  8. mirrorMoveVertically(Point move, int size)
  9. nearestColinearPoint(final double x1, final double y1, final double x2, final double y2, double x, double y)