Skip to content

Commit

Permalink
include codeSnip
Browse files Browse the repository at this point in the history
  • Loading branch information
freakin23 committed Oct 28, 2024
1 parent 7bd54ab commit 4090c3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion solutions/platinum/kattis-segmentintersection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Line Segment Intersection
author: Rameez Parwez
---

[Unoffical Analysis](https://cp-algorithms.com/geometry/segments-intersection.html)

## Implementation

**Time Complexity:** $\mathcal{O}(T)$, where $T$ is the number of test cases.
Expand All @@ -16,6 +18,7 @@ author: Rameez Parwez
#include <bits/stdc++.h>
using namespace std;

// BeginCodeSnip{Finding intersection of two segments from CP Algorithms}
const double EPS = 1E-9;

struct Point {
Expand Down Expand Up @@ -94,7 +97,7 @@ bool intersect(Point a, Point b, Point c, Point d, Point& left, Point& right) {
betw(c.x, d.x, left.x) && betw(c.y, d.y, left.y);
}
}

// EndCodeSnip

int main() {
int test_case;
Expand Down

0 comments on commit 4090c3c

Please sign in to comment.