final double an = (e.getPosition().radian(m.getPosition()) + (Math.PI * 1.5)) % (Math.PI * 2); final double lw = 1;   C3Poly = new Polygon(); C3Poly.addPoint(a.x + 42 - (int)Math.round(Math.sin(an) * lw), a.y + 36 + (int)Math.round(Math.cos(an) * lw)); C3Poly.addPoint(a.x + 42 + (int)Math.round(Math.sin(an) * lw), a.y + 36 - (int)Math.round(Math.cos(an) * lw)); C3Poly.addPoint(t.x + 42 + (int)Math.round(Math.sin(an) * lw), t.y + 36 - (int)Math.round(Math.cos(an) * lw)); C3Poly.addPoint(t.x + 42 - (int)Math.round(Math.sin(an) * lw), t.y + 36 + (int)Math.round(Math.cos(an) * lw));
makePoly();
        public C3Sprite(Entity e, Entity m) {            this.entityId = e.getId();            this.masterId = m.getId();            this.spriteColor = e.getOwner().getColor();            if(e.getPosition() == null || m.getPosition() == null) {                C3Poly = new Polygon();                C3Poly.addPoint(0, 0);                C3Poly.addPoint(1,0);                C3Poly.addPoint(0,1);                this.bounds = new Rectangle(C3Poly.getBounds());                bounds.setSize(bounds.getSize().width + 1, bounds.getSize().height + 1);                this.image = null;                return;            }            final Point a = getHexLocation(e.getPosition());            final Point t = getHexLocation(m.getPosition());            final double an = (e.getPosition().radian(m.getPosition()) + (Math.PI * 1.5)) % (Math.PI * 2); // angle            final double lw = 1; // line width            // make a polygon            C3Poly = new Polygon();            C3Poly.addPoint(a.x + 42 - (int)Math.round(Math.sin(an) * lw), a.y + 36 + (int)Math.round(Math.cos(an) * lw));            C3Poly.addPoint(a.x + 42 + (int)Math.round(Math.sin(an) * lw), a.y + 36 - (int)Math.round(Math.cos(an) * lw));            C3Poly.addPoint(t.x + 42 + (int)Math.round(Math.sin(an) * lw), t.y + 36 - (int)Math.round(Math.cos(an) * lw));            C3Poly.addPoint(t.x + 42 - (int)Math.round(Math.sin(an) * lw), t.y + 36 + (int)Math.round(Math.cos(an) * lw));            // set bounds            this.bounds = new Rectangle(C3Poly.getBounds());            bounds.setSize(bounds.getSize().width + 1, bounds.getSize().height + 1);            // move poly to upper right of image            C3Poly.translate(-bounds.getLocation().x, -bounds.getLocation().y);            // set names & stuff            // nullify image            this.image = null;        }