public void MovingCentre(PointXY newCentre) { PointXY oldCentre = CentrePoint; A = A + (newCentre - CentrePoint); B = B + (newCentre - CentrePoint); C = C + (newCentre - CentrePoint); }
PointXY TurnPoint(PointXY somePoint, PointXY centrePoint, double angleInRadian) { PointXY temporaryPoint = somePoint; temporaryPoint.x = temporaryPoint.x - centrePoint.x; temporaryPoint.y = temporaryPoint.y - centrePoint.y; somePoint.x = (Math.Cos(angleInRadian) * temporaryPoint.x) - (Math.Sin(angleInRadian) * temporaryPoint.y); somePoint.y = (Math.Sin(angleInRadian) * temporaryPoint.x) + (Math.Cos(angleInRadian) * temporaryPoint.y); somePoint.x = somePoint.x + centrePoint.x; somePoint.y = somePoint.y + centrePoint.y; return somePoint; }
public Triangle(PointXY A, PointXY B, PointXY C) { this.A = A; this.B = B; this.C = C; }