math_demo 0.5.0-java → 0.6.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/math_demo/triangle_point.rb +5 -9
- data/lib/math_demo/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ae001a1788c1fd9325730e3fef92f7c70cf4a3eef613f28471eb103682696e2
|
4
|
+
data.tar.gz: d6f440d556cac0a5b54efbddf6475e6887de97968d157bd7dffeafa15440c5d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb4215258ad859aa2ea7a15466d67fc4259ee96d55f2efc0c7b5cdb3944e975a5197bf9c5758f0c9829c9df67f03d35a98cbd278f1a381aa3bde62277759c6ae
|
7
|
+
data.tar.gz: fcf6605c2e53630bfb17cda2ce9defd5fdc445c9f236244ccbece592b09f0833154e1d00784c97ebdc23ddf9a340da368cade2727c143571bb32f85cb7ac36b6
|
@@ -9,7 +9,7 @@ class TPoint
|
|
9
9
|
@pos = position
|
10
10
|
@vel = Vec2D.new
|
11
11
|
@accel = Vec2D.random
|
12
|
-
@bounds = Boundary.new(
|
12
|
+
@bounds = [Boundary.new(0, width), Boundary.new(0, height)]
|
13
13
|
end
|
14
14
|
|
15
15
|
def direction(acc)
|
@@ -32,18 +32,14 @@ class TPoint
|
|
32
32
|
private
|
33
33
|
|
34
34
|
def check_bounds
|
35
|
-
@vel.x *= -1 if bounds.
|
36
|
-
@vel.y *= -1 if bounds.
|
35
|
+
@vel.x *= -1 if bounds[0].exclude? pos.x
|
36
|
+
@vel.y *= -1 if bounds[1].exclude? pos.y
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
# we are looking for excluded values
|
41
41
|
Boundary = Struct.new(:lower, :upper) do
|
42
|
-
def
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
def exclude_y?(val)
|
47
|
-
!((lower.y...upper.y).cover? val.y)
|
42
|
+
def exclude?(val)
|
43
|
+
true unless (lower...upper).cover? val
|
48
44
|
end
|
49
45
|
end
|
data/lib/math_demo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: math_demo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- monkstone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: propane
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.11'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '5.
|
47
|
+
version: '5.10'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '5.
|
54
|
+
version: '5.10'
|
55
55
|
description: |2
|
56
56
|
Geomerative art using the ruby Matrix class to generate circumcircles around
|
57
57
|
triangles, created from moving points
|
@@ -79,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '2.
|
82
|
+
version: '2.6'
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - ">="
|