Skip to content

Commit 50a3915

Browse files
committed
Shortened a bit
1 parent 4cb642a commit 50a3915

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

content/geometry/HalfPlane.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ vector<P> halfPlaneIntersection(vector<Line> vs) {
4040
while (i!=n && ah<at && sideOf(sp(vs[i]),ans[ah])<0) ah++;
4141
auto res = lineInter(sp(vs[i]), sp(deq[at]));
4242
if (res.first != 1) continue;
43-
ans[at++] = res.second;
44-
deq[at] = vs[i];
43+
ans[at++] = res.second, deq[at] = vs[i];
4544
}
4645
if (at - ah <= 2) return {};
4746
return {ans.begin() + ah, ans.begin() + at};

content/geometry/lineIntersection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ template <class P> pair<int, P> lineInter(P s1, P e1, P s2, P e2) {
2727
if (d == 0) // if parallel
2828
return {-(s1.cross(e1, s2) == 0 || s2 == e2), P(0, 0)};
2929
else {
30-
3130
double a1 = s2.cross(e2, s1), a2 = -s2.cross(e2, e1);
3231
return {1, (s1 * a2 + e1 * a1) / (a1 + a2)};
3332
}

0 commit comments

Comments
 (0)