package cse1030; /** * A simple triangle class where a Triangle is an composition of three Point * objects. * * @author CSE1030 * */ public class TriangleC { private Point pA; private Point pB; private Point pC; public TriangleC() { this(new Point(0., 0., 0.), new Point(0., 1., 0.), new Point(1., 0., 0.)); } public TriangleC(Point a, Point b, Point c) { this.pA = new Point(a); this.pB = new Point(b); this.pC = new Point(c); } public TriangleC(TriangleC other) { // this(other.pA, other.pB, other.pC); this.pA = other.getA(); this.pB = other.getB(); this.pC = other.getC(); } public Point getA() { return new Point(this.pA); } public void setA(Point a) { Point copy = new Point(a); // validate? this.pA = copy; } public Point getB() { return new Point(this.pB); } public void setB(Point b) { Point copy = new Point(b); // validate? this.pB = copy; } public Point getC() { return new Point(this.pC); } public void setC(Point c) { Point copy = new Point(c); // validate? this.pC = copy; } }