Package eas.math.geometry

Examples of eas.math.geometry.Polygon2D


    public Polygon2D getAgentShape() {
        if (pacman == null) {
            final double radius = 0.5;

            final double precision = 7;
            pacman = new Polygon2D();
            final double beg = -1 * Math.PI / 8;
           
            for (double d = beg; d < Math.PI * 2.1 + beg; d += Math.PI * 2 / precision) {
                pacman.add(new Vector2D(Math.sin(d) * radius, Math.cos(d) * radius));
            }
View Full Code Here


  private Polygon2D shape;
 
  @Override
  public Polygon2D getAgentShape() {
    if (shape == null) {
      shape = new Polygon2D();
      shape.add(new Vector2D(0.5, 0.5));
      shape.add(new Vector2D(-0.5, 0.5));
      shape.add(new Vector2D(-0.5, -0.5));
      shape.add(new Vector2D(0.5, -0.5));
      }
View Full Code Here

    @Override
    public Polygon2D getAgentShape() {
        if (circle == null) {
            final double precision = 60;
            final double radius = 1;
            circle = new Polygon2D();
           
            for (double d = 0; d < Math.PI * 2; d += Math.PI * 2 / precision) {
                circle.add(new Vector2D(Math.sin(d) * radius, Math.cos(d) * radius));
            }
        }
View Full Code Here

   
    private static Polygon2D jasmineShape;
   
    public static Polygon2D getJasmineShape() {
        if (jasmineShape == null) {
            jasmineShape = new Polygon2D();
            jasmineShape.add(new Vector2D(
                    0,
                    0));
            jasmineShape.add(new Vector2D(
                    ConstantsSimulation.ROB_AUSDEHNUNG_X,
View Full Code Here

    @Override
    public Polygon2D getAgentShape() {
        if (pol == null) {
            final double precision = 17;
            final double radius = 7;
            pol = new Polygon2D();

            for (double d = 0; d < Math.PI * 2; d += Math.PI * 2 / precision) {
                pol.add(new Vector2D(Math.sin(d) * radius, Math.cos(d) * radius));
            }
        }
View Full Code Here

    private Polygon2D shape;
   
    @Override
    public strictfp Polygon2D getAgentShape() {
        if (shape == null) {
            shape = new Polygon2D();
            shape.add(new Vector2D(0, 0));
            shape.add(new Vector2D(40, 0));
            shape.add(new Vector2D(40, 2));
            shape.add(new Vector2D(0, 2));
        }
View Full Code Here

    private Polygon2D shape;
   
    @Override
    public strictfp Polygon2D getAgentShape() {
        if (shape == null) {
            shape = new Polygon2D();
            shape.add(new Vector2D(0, 0));
            shape.add(new Vector2D(100, 0));
            shape.add(new Vector2D(100, 2));
            shape.add(new Vector2D(0, 2));
        }
View Full Code Here

    return true;
  }
 
    @Override
    public Polygon2D getAgentShape() {
        Polygon2D p = new Polygon2D();
        p.add(new Vector2D(60, -10));
        p.add(new Vector2D(60, 10));
        p.add(new Vector2D(-60, 10));
        p.add(new Vector2D(-60, -10));
        return p;
    }
View Full Code Here

     *
     */
    private static final long serialVersionUID = -9097007422935549253L;

    public Shape polToShape(final Polygon2D polygon) {
        Polygon2D pol = polygon.getCounterClockwiseOrdered();
       
        ROVector2f[] vecs = new ROVector2f[pol.nPoints()];
       
        for (int i = 0; i < pol.nPoints(); i++) {
            vecs[i] = new Vector2f((float) pol.get(i).x, (float) pol.get(i).y);
        }
       
        Polygon p = new Polygon(vecs);
        return p;
    }
View Full Code Here

            shape.add(new Vector2D(5, 0));
            shape.add(new Vector2D(5, 2));
            shape.add(new Vector2D(-5, 2));
            shape.translateRootPointToMiddle(); */
           
            shape = new Polygon2D();
        shape.add(new Vector2D(-2.5, -2.5));
        shape.add(new Vector2D(2.5, -2.5));
        shape.add(new Vector2D(0, 5));
        }
       
View Full Code Here

TOP

Related Classes of eas.math.geometry.Polygon2D

Copyright © 2018 www.massapicom. 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.