diff --git a/year25/day9/part2.go b/year25/day9/part2.go index 72f1758..71565c5 100644 --- a/year25/day9/part2.go +++ b/year25/day9/part2.go @@ -79,7 +79,7 @@ func isP1InsideP2(p1, p2 []Vertex) bool { for _, rectangleVertex := range p1 { corner := rectangleVertex.Start // for each point of retangle // check if corner is on vertex. if yes we are fine - // count vertexes + // count vertices verticesPassed := 0 for _, v := range p2 { if isPointOnLine(corner, v) { @@ -102,11 +102,9 @@ func isP1InsideP2(p1, p2 []Vertex) bool { func isPointOnLine(p geometry.Point, l Vertex) bool { v := p.Subs(l.Start) w := l.End.Subs(l.Start) - if v.Line*w.Col != v.Col*w.Line { return false } - return w.Dot(p.Subs(l.End)) <= 0 } func polygonsIntersect(p1, p2 []Vertex) bool {