scale method
- num factor
override
Scales the shape uniformly by the given factor originating from centroid.
Implementation
@override
LineSegment scale(num factor) {
final c = centroid;
Point<num> scalePoint(Point<num> p) => Point(
x: c.x + (p.x - c.x) * factor,
y: c.y + (p.y - c.y) * factor
);
return LineSegment(p1: scalePoint(p1), p2: scalePoint(p2));
}