polygon-validator 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/polygon/validator.rb +2 -4
- data/lib/polygon/validator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b16c4517951c68fc52803f275cfb1bdcb799c8671f30f8f4925776a101ce20f5
|
4
|
+
data.tar.gz: 821c23ba73107e01b50eab2271b08c2802bfa4f6778ccca10b0a236e76bbbaad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfa4f50d1e511690ba03f7a190e771565d583fd13b68d40c8d303c38a1de3cb63e8a1939930275232b96800fc8bc367cb4e15dd7cd9e98778c8ddadf79830d80
|
7
|
+
data.tar.gz: 8b1a139de9da53916ca787b152fd7fc53a10302abd0f5d140eb774e56454bdfbb5f39027bcf99404885f944750af83f4358d7ceba8fdf073935b406223849474
|
data/Gemfile.lock
CHANGED
data/lib/polygon/validator.rb
CHANGED
@@ -19,14 +19,12 @@ module Polygon
|
|
19
19
|
@shape = shape
|
20
20
|
end
|
21
21
|
|
22
|
-
# Validate if a point is inside
|
22
|
+
# Validate if a point is inside the shape
|
23
23
|
#
|
24
24
|
# @param [Polygon::Point] point the point to validate if it is inside the
|
25
25
|
# shape
|
26
|
-
# @param [Polygon::Shape] shape the shape that may or may not contain the
|
27
|
-
# point
|
28
26
|
# @return [true, false] true if point is inside the shape
|
29
|
-
def
|
27
|
+
def contains_point?(point)
|
30
28
|
points = shape.points
|
31
29
|
winding_number = 0
|
32
30
|
|