Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package model.angled;
- import model.Point;
- import util.Constants;
- public class EquilateralTriangleElement extends TriangleElement {
- public EquilateralTriangleElement() {
- super(new Point[] { new Point(0, 0), new Point(0, 0), new Point(0, 0)});
- }
- public EquilateralTriangleElement(double posX, double posY, double width) {
- super(new Point[] { new Point(posX, posY), new Point(posX + width, posX), new Point( width/2,Math.sqrt(3)/2)});
- //setWidth(width); //TODO
- }
- @Override
- public EquilateralTriangleElement cloneElement() {
- EquilateralTriangleElement hex = new EquilateralTriangleElement();
- hex.changeColorCode(super.getColorCode());
- // copy the points
- Point[] p = new Point[super.getPoints().length];
- for (int i = 0; i < p.length; i++) {
- Point old = super.getPoint(i);
- Point n = new Point(old.getX(), old.getY());
- p[i] = n;
- }
- hex.setPoints(p);
- return hex;
- }
- @Override
- protected String getJSONClassName() {
- // TODO Auto-generated method stub
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement