intersections method
Implementation
List<Vector2> intersections(LineSegment otherSegment) {
final result = toLine().intersections(otherSegment.toLine());
if (result.isNotEmpty) {
final intersection = result.first;
if (containsPoint(intersection) && otherSegment.containsPoint(intersection)) {
return result;
}
}
return [];
}