Java Geometry Polygon makeArea(Polygon polygon, int steps, int dX, int dY)

Here you can find the source of makeArea(Polygon polygon, int steps, int dX, int dY)

Description

make Area

License

Apache License

Declaration

public static Polygon makeArea(Polygon polygon, int steps, int dX, int dY) 

Method Source Code


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

import java.awt.Polygon;

public class Main {
    public static Polygon makeArea(Polygon polygon, int steps, int dX, int dY) {
        // make this an area!
        for (int i = steps - 1; i >= 0; --i) {
            polygon.addPoint(polygon.xpoints[i] + dX, polygon.ypoints[i] + dY);
        }// ww  w  .  j a v a 2 s  .c  o  m
        return polygon;
    }
}

Related

  1. boundingTest(Polygon p, int x, int y, int w, int h)
  2. inside_polygon(float[] xpts, float[] ypts, double ptx, double pty)
  3. polyArea(Polygon target)
  4. regularPolygon(int sides, double x, double y, double width, double height)
  5. sparsifyPolygon(java.awt.Polygon p, double minDistance)