Skip to content

Commit b5fb51f

Browse files
committed
Tiny description fixes
1 parent 2aad7c9 commit b5fb51f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

content/geometry/lineIntersection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Source:
66
* Description:\\
77
\begin{minipage}{75mm}
8-
If a unique intersetion point of the lines going through s1,e1 and s2,e2 exists r is set to this point and 1 is returned. If no intersection point exists 0 is returned and if infinitely many exists -1 is returned. If s1==e1 or s2==e2 -1 is returned. The wrong position will be returned if P is Point<int> and the intersection point does not have integer coordinates. Products of three coordinates are used in intermediate steps so watch out for overflow if using int or long long.
8+
If a unique intersection point of the lines going through s1,e1 and s2,e2 exists r is set to this point and 1 is returned. If no intersection point exists 0 is returned and if infinitely many exists -1 is returned. If s1==e1 or s2==e2 -1 is returned. The wrong position will be returned if P is Point<ll> and the intersection point does not have integer coordinates. Products of three coordinates are used in intermediate steps so watch out for overflow if using int or long long.
99
\end{minipage}
1010
\begin{minipage}{15mm}
1111
\includegraphics[width=\textwidth]{content/geometry/lineIntersection}
@@ -23,7 +23,7 @@ If a unique intersetion point of the lines going through s1,e1 and s2,e2 exists
2323
template<class P>
2424
int lineIntersection(const P& s1, const P& e1, const P& s2,
2525
const P& e2, P& r) {
26-
if ((e1-s1).cross(e2-s2)) { //if not parallell
26+
if ((e1-s1).cross(e2-s2)) { // if not parallel
2727
r = s2-(e2-s2)*(e1-s1).cross(s2-s1)/(e1-s1).cross(e2-s2);
2828
return 1;
2929
} else

content/geometry/onSegment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
* Date: 2019-04-26
44
* License: CC0
55
* Source: https://vlecomte.github.io/cp-geo.pdf
6-
* Description: Returns true iff p lies on the line segment from s to e. Intended for use with e.g. Point<long long> where overflow is an issue. Use (segDist(s,e,p)<=epsilon) instead when using Point<double>.
6+
* Description: Returns true iff p lies on the line segment from s to e. Intended for use with e.g. Point<ll> where overflow is an issue. Use \texttt{(segDist(s,e,p)<=epsilon)} instead when using Point<double>.
77
* Status:
88
*/
99
#pragma once
1010

1111
#include "Point.h"
1212

13-
template <class P> bool onSegment(P s, P e, P p) {
13+
template<class P> bool onSegment(P s, P e, P p) {
1414
return p.cross(s, e) == 0 && (s - p).dot(e - p) <= 0;
1515
}

0 commit comments

Comments
 (0)