picrate 2.4.1-java → 2.5.2-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.mvn/wrapper/maven-wrapper.properties +1 -1
- data/CHANGELOG.md +9 -1
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/docs/.gitignore +1 -0
- data/docs/_classes/{app_render → gfx_render}/app_render.md +5 -5
- data/docs/_classes/vec2d/vec2d.md +2 -2
- data/docs/_methods/{noise_mode.md → noise_modes.md} +9 -21
- data/docs/_posts/2018-05-06-install_jruby.md +5 -5
- data/docs/_posts/2019-11-11-getting_started_buster.md +2 -2
- data/docs/_posts/2020-05-11-getting_started_manjaro.md +13 -4
- data/docs/about.md +1 -1
- data/lib/picrate/app.rb +2 -8
- data/lib/picrate/helper_methods.rb +6 -6
- data/lib/picrate/version.rb +1 -1
- data/lib/picrate-2.5.2.jar +0 -0
- data/picrate.gemspec +1 -1
- data/pom.rb +4 -4
- data/pom.xml +6 -9
- data/src/main/java/monkstone/vecmath/GfxRender.java +10 -11
- data/src/main/java/monkstone/vecmath/JRender.java +7 -7
- data/src/main/java/monkstone/vecmath/ShapeRender.java +3 -4
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +40 -43
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +30 -45
- data/src/main/java/processing/awt/PImageAWT.java +1 -1
- data/src/main/java/processing/awt/ShimAWT.java +1 -1
- data/src/main/java/processing/core/PApplet.java +1 -1
- data/src/main/java/processing/core/PImage.java +14 -14
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
- data/src/main/java/processing/opengl/PShader.java +0 -6
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +4 -4
- data/src/main/{java/processing/opengl → resources}/cursors/arrow.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/cross.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/hand.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/license.txt +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/move.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/text.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/wait.png +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/ColorFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/ColorVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/LightFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/LightVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/LineFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/LineVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/MaskFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/PointFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/PointVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/TexFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/TexLightFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/TexLightVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/TexVert.glsl +0 -0
- data/test/noise_test.rb +17 -0
- data/test/test_helper.rb +1 -1
- data/test/vecmath_spec_test.rb +3 -3
- data/vendors/Rakefile +1 -1
- metadata +30 -41
- data/lib/picrate-2.4.1.jar +0 -0
- data/src/main/java/japplemenubar/JAppleMenuBar.java +0 -96
- data/src/main/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
- data/src/main/java/monkstone/complex/JComplex.java +0 -252
- data/src/main/java/monkstone/vecmath/AppRender.java +0 -88
- data/src/main/java/monkstone/vecmath/package-info.java +0 -20
- data/src/main/java/monkstone/vecmath/vec2/package-info.java +0 -6
- data/src/main/java/monkstone/vecmath/vec3/package-info.java +0 -6
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/test/noise_test.rb
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'test_helper'
|
|
4
|
+
|
|
5
|
+
Java::Monkstone::PicrateLibrary.new.load(JRuby.runtime, false)
|
|
6
|
+
|
|
7
|
+
# include Processing::HelperMethods
|
|
8
|
+
|
|
9
|
+
Dir.chdir(File.dirname(__FILE__))
|
|
10
|
+
# Test processing map functions
|
|
11
|
+
class ProcessingNoiseTest < Minitest::Test
|
|
12
|
+
include NoiseModule
|
|
13
|
+
def test_noise1d
|
|
14
|
+
x = 0.5
|
|
15
|
+
assert_in_delta(noise(x), 0.5, 0.00001)
|
|
16
|
+
end
|
|
17
|
+
end
|
data/test/test_helper.rb
CHANGED
data/test/vecmath_spec_test.rb
CHANGED
|
@@ -270,14 +270,14 @@ class VecmathTest < Minitest::Test
|
|
|
270
270
|
a = Vec2D.new(200, 0)
|
|
271
271
|
b = Vec2D.new(0, 200)
|
|
272
272
|
# Expected result is an area, twice that of the triangle created by the vectors
|
|
273
|
-
assert_equal(a
|
|
273
|
+
assert_equal((a ^ b).abs, 40_000.0, 'Failed area test using 2D vector cross product')
|
|
274
274
|
end
|
|
275
275
|
|
|
276
276
|
def test_cross_non_zero # Could be used to calculate area of triangle
|
|
277
277
|
a = Vec2D.new(40, 40)
|
|
278
278
|
b = Vec2D.new(40, 140)
|
|
279
279
|
c = Vec2D.new(140, 40)
|
|
280
|
-
assert_equal((a - b)
|
|
280
|
+
assert_equal(((a - b) ^ (b - c)).abs / 2, 5_000.0, 'Failed area calculation using 2D vector cross product')
|
|
281
281
|
end
|
|
282
282
|
|
|
283
283
|
def test_cross_zero # where a, b, c are collinear area == 0
|
|
@@ -285,7 +285,7 @@ class VecmathTest < Minitest::Test
|
|
|
285
285
|
b = Vec2D.new(100, 100)
|
|
286
286
|
c = Vec2D.new(200, 200)
|
|
287
287
|
# see http://mathworld.wolfram.com/Collinear.html for details
|
|
288
|
-
assert((a - b)
|
|
288
|
+
assert(((a - b) ^ (b - c)).zero?, 'Failed collinearity test using 2D vector cross product')
|
|
289
289
|
end
|
|
290
290
|
|
|
291
291
|
def test_equals3
|
data/vendors/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ SOUND = 'sound.zip'
|
|
|
8
8
|
PROCESSING_GITHUB = 'https://github.com/processing'
|
|
9
9
|
VIDEO = 'video.zip'
|
|
10
10
|
DOWNLOAD = 'releases/download/latest'
|
|
11
|
-
EXAMPLES = '0.5.
|
|
11
|
+
EXAMPLES = '0.5.9'
|
|
12
12
|
HOME_DIR = ENV['HOME']
|
|
13
13
|
LIBRARY = File.join(HOME_DIR, '.picrate', 'libraries')
|
|
14
14
|
PROJECT_DIR = File.join(HOME_DIR, 'projects')
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: picrate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.5.2
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- monkstone
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-12-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -43,10 +43,7 @@ dependencies:
|
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '1.
|
|
47
|
-
- - ">="
|
|
48
|
-
- !ruby/object:Gem::Version
|
|
49
|
-
version: 1.0.1
|
|
46
|
+
version: '1.2'
|
|
50
47
|
name: arcball
|
|
51
48
|
prerelease: false
|
|
52
49
|
type: :runtime
|
|
@@ -54,10 +51,7 @@ dependencies:
|
|
|
54
51
|
requirements:
|
|
55
52
|
- - "~>"
|
|
56
53
|
- !ruby/object:Gem::Version
|
|
57
|
-
version: '1.
|
|
58
|
-
- - ">="
|
|
59
|
-
- !ruby/object:Gem::Version
|
|
60
|
-
version: 1.0.1
|
|
54
|
+
version: '1.2'
|
|
61
55
|
description: |
|
|
62
56
|
A batteries included version of processing in ruby, for raspberrypi and
|
|
63
57
|
linux. Install samples to configures geany ide.
|
|
@@ -82,10 +76,10 @@ files:
|
|
|
82
76
|
- docs/.gitignore
|
|
83
77
|
- docs/_classes/aabb/aabb.md
|
|
84
78
|
- docs/_classes/app/app.md
|
|
85
|
-
- docs/_classes/app_render/app_render.md
|
|
86
79
|
- docs/_classes/arc_ball/arc_ball.md
|
|
87
80
|
- docs/_classes/chooser/chooser.md
|
|
88
81
|
- docs/_classes/deglut/deglut.md
|
|
82
|
+
- docs/_classes/gfx_render/app_render.md
|
|
89
83
|
- docs/_classes/library_proxy/library_proxy.md
|
|
90
84
|
- docs/_classes/vec2d/vec2d.md
|
|
91
85
|
- docs/_classes/vec3d/vec3d.md
|
|
@@ -130,7 +124,7 @@ files:
|
|
|
130
124
|
- docs/_methods/map1d.md
|
|
131
125
|
- docs/_methods/methods_summary.md
|
|
132
126
|
- docs/_methods/mouse_pressed.md
|
|
133
|
-
- docs/_methods/
|
|
127
|
+
- docs/_methods/noise_modes.md
|
|
134
128
|
- docs/_methods/post_initialize.md
|
|
135
129
|
- docs/_methods/processing_api.md
|
|
136
130
|
- docs/_methods/settings.md
|
|
@@ -191,7 +185,7 @@ files:
|
|
|
191
185
|
- lib/jogl-all-natives-linux-amd64.jar
|
|
192
186
|
- lib/jogl-all-natives-linux-armv6hf.jar
|
|
193
187
|
- lib/jogl-all.jar
|
|
194
|
-
- lib/picrate-2.
|
|
188
|
+
- lib/picrate-2.5.2.jar
|
|
195
189
|
- lib/picrate.rb
|
|
196
190
|
- lib/picrate/app.rb
|
|
197
191
|
- lib/picrate/creators/parameters.rb
|
|
@@ -227,14 +221,11 @@ files:
|
|
|
227
221
|
- picrate.gemspec
|
|
228
222
|
- pom.rb
|
|
229
223
|
- pom.xml
|
|
230
|
-
- src/main/java/japplemenubar/JAppleMenuBar.java
|
|
231
|
-
- src/main/java/japplemenubar/libjAppleMenuBar.jnilib
|
|
232
224
|
- src/main/java/monkstone/ColorUtil.java
|
|
233
225
|
- src/main/java/monkstone/FastNoiseModuleJava.java
|
|
234
226
|
- src/main/java/monkstone/MathToolModule.java
|
|
235
227
|
- src/main/java/monkstone/PicrateLibrary.java
|
|
236
228
|
- src/main/java/monkstone/SmoothNoiseModuleJava.java
|
|
237
|
-
- src/main/java/monkstone/complex/JComplex.java
|
|
238
229
|
- src/main/java/monkstone/core/LibraryProxy.java
|
|
239
230
|
- src/main/java/monkstone/fastmath/DegLutTables.java
|
|
240
231
|
- src/main/java/monkstone/fastmath/Deglut.java
|
|
@@ -251,15 +242,11 @@ files:
|
|
|
251
242
|
- src/main/java/monkstone/slider/SliderBar.java
|
|
252
243
|
- src/main/java/monkstone/slider/SliderGroup.java
|
|
253
244
|
- src/main/java/monkstone/slider/WheelHandler.java
|
|
254
|
-
- src/main/java/monkstone/vecmath/AppRender.java
|
|
255
245
|
- src/main/java/monkstone/vecmath/GfxRender.java
|
|
256
246
|
- src/main/java/monkstone/vecmath/JRender.java
|
|
257
247
|
- src/main/java/monkstone/vecmath/ShapeRender.java
|
|
258
|
-
- src/main/java/monkstone/vecmath/package-info.java
|
|
259
248
|
- src/main/java/monkstone/vecmath/vec2/Vec2.java
|
|
260
|
-
- src/main/java/monkstone/vecmath/vec2/package-info.java
|
|
261
249
|
- src/main/java/monkstone/vecmath/vec3/Vec3.java
|
|
262
|
-
- src/main/java/monkstone/vecmath/vec3/package-info.java
|
|
263
250
|
- src/main/java/monkstone/videoevent/CaptureEvent.java
|
|
264
251
|
- src/main/java/monkstone/videoevent/MovieEvent.java
|
|
265
252
|
- src/main/java/monkstone/videoevent/package-info.java
|
|
@@ -318,28 +305,15 @@ files:
|
|
|
318
305
|
- src/main/java/processing/opengl/PSurfaceJOGL.java
|
|
319
306
|
- src/main/java/processing/opengl/Texture.java
|
|
320
307
|
- src/main/java/processing/opengl/VertexBuffer.java
|
|
321
|
-
- src/main/java/processing/opengl/cursors/arrow.png
|
|
322
|
-
- src/main/java/processing/opengl/cursors/cross.png
|
|
323
|
-
- src/main/java/processing/opengl/cursors/hand.png
|
|
324
|
-
- src/main/java/processing/opengl/cursors/license.txt
|
|
325
|
-
- src/main/java/processing/opengl/cursors/move.png
|
|
326
|
-
- src/main/java/processing/opengl/cursors/text.png
|
|
327
|
-
- src/main/java/processing/opengl/cursors/wait.png
|
|
328
|
-
- src/main/java/processing/opengl/shaders/ColorFrag.glsl
|
|
329
|
-
- src/main/java/processing/opengl/shaders/ColorVert.glsl
|
|
330
|
-
- src/main/java/processing/opengl/shaders/LightFrag.glsl
|
|
331
|
-
- src/main/java/processing/opengl/shaders/LightVert.glsl
|
|
332
|
-
- src/main/java/processing/opengl/shaders/LineFrag.glsl
|
|
333
|
-
- src/main/java/processing/opengl/shaders/LineVert.glsl
|
|
334
|
-
- src/main/java/processing/opengl/shaders/MaskFrag.glsl
|
|
335
|
-
- src/main/java/processing/opengl/shaders/PointFrag.glsl
|
|
336
|
-
- src/main/java/processing/opengl/shaders/PointVert.glsl
|
|
337
|
-
- src/main/java/processing/opengl/shaders/TexFrag.glsl
|
|
338
|
-
- src/main/java/processing/opengl/shaders/TexLightFrag.glsl
|
|
339
|
-
- src/main/java/processing/opengl/shaders/TexLightVert.glsl
|
|
340
|
-
- src/main/java/processing/opengl/shaders/TexVert.glsl
|
|
341
308
|
- src/main/java/processing/pdf/PGraphicsPDF.java
|
|
342
309
|
- src/main/java/processing/svg/PGraphicsSVG.java
|
|
310
|
+
- src/main/resources/cursors/arrow.png
|
|
311
|
+
- src/main/resources/cursors/cross.png
|
|
312
|
+
- src/main/resources/cursors/hand.png
|
|
313
|
+
- src/main/resources/cursors/license.txt
|
|
314
|
+
- src/main/resources/cursors/move.png
|
|
315
|
+
- src/main/resources/cursors/text.png
|
|
316
|
+
- src/main/resources/cursors/wait.png
|
|
343
317
|
- src/main/resources/icon/icon-128.png
|
|
344
318
|
- src/main/resources/icon/icon-16.png
|
|
345
319
|
- src/main/resources/icon/icon-256.png
|
|
@@ -348,10 +322,24 @@ files:
|
|
|
348
322
|
- src/main/resources/icon/icon-512.png
|
|
349
323
|
- src/main/resources/icon/icon-64.png
|
|
350
324
|
- src/main/resources/license.txt
|
|
325
|
+
- src/main/resources/shaders/ColorFrag.glsl
|
|
326
|
+
- src/main/resources/shaders/ColorVert.glsl
|
|
327
|
+
- src/main/resources/shaders/LightFrag.glsl
|
|
328
|
+
- src/main/resources/shaders/LightVert.glsl
|
|
329
|
+
- src/main/resources/shaders/LineFrag.glsl
|
|
330
|
+
- src/main/resources/shaders/LineVert.glsl
|
|
331
|
+
- src/main/resources/shaders/MaskFrag.glsl
|
|
332
|
+
- src/main/resources/shaders/PointFrag.glsl
|
|
333
|
+
- src/main/resources/shaders/PointVert.glsl
|
|
334
|
+
- src/main/resources/shaders/TexFrag.glsl
|
|
335
|
+
- src/main/resources/shaders/TexLightFrag.glsl
|
|
336
|
+
- src/main/resources/shaders/TexLightVert.glsl
|
|
337
|
+
- src/main/resources/shaders/TexVert.glsl
|
|
351
338
|
- test/color_group_test.rb
|
|
352
339
|
- test/deglut_spec_test.rb
|
|
353
340
|
- test/helper_methods_test.rb
|
|
354
341
|
- test/math_tool_test.rb
|
|
342
|
+
- test/noise_test.rb
|
|
355
343
|
- test/respond_to_test.rb
|
|
356
344
|
- test/sketches/key_event.rb
|
|
357
345
|
- test/sketches/library/my_library/my_library.rb
|
|
@@ -381,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
381
369
|
version: '0'
|
|
382
370
|
requirements:
|
|
383
371
|
- java runtime == 11+
|
|
384
|
-
rubygems_version: 3.
|
|
372
|
+
rubygems_version: 3.2.29
|
|
385
373
|
signing_key:
|
|
386
374
|
specification_version: 4
|
|
387
375
|
summary: ruby implementation of processing-3 on raspberrypi and linux64
|
|
@@ -390,6 +378,7 @@ test_files:
|
|
|
390
378
|
- test/deglut_spec_test.rb
|
|
391
379
|
- test/helper_methods_test.rb
|
|
392
380
|
- test/math_tool_test.rb
|
|
381
|
+
- test/noise_test.rb
|
|
393
382
|
- test/respond_to_test.rb
|
|
394
383
|
- test/sketches/key_event.rb
|
|
395
384
|
- test/sketches/library/my_library/my_library.rb
|
data/lib/picrate-2.4.1.jar
DELETED
|
Binary file
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Part of the Processing project - http://processing.org
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2011-12 hansi raber, released under LGPL under agreement
|
|
5
|
-
|
|
6
|
-
This library is free software; you can redistribute it and/or
|
|
7
|
-
modify it under the terms of the GNU Lesser General Public
|
|
8
|
-
License as published by the Free Software Foundation, version 2.1.
|
|
9
|
-
|
|
10
|
-
This library is distributed in the hope that it will be useful,
|
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
-
Lesser General Public License for more details.
|
|
14
|
-
|
|
15
|
-
You should have received a copy of the GNU Lesser General
|
|
16
|
-
Public License along with this library; if not, write to the
|
|
17
|
-
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
18
|
-
Boston, MA 02111-1307 USA
|
|
19
|
-
*/
|
|
20
|
-
package japplemenubar;
|
|
21
|
-
|
|
22
|
-
import java.io.*;
|
|
23
|
-
|
|
24
|
-
import processing.core.PApplet;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Starting point for the application. General initialization should be done
|
|
29
|
-
* inside the ApplicationController's init() method. If certain kinds of
|
|
30
|
-
* non-Swing initialization takes too long, it should happen in a new Thread
|
|
31
|
-
* and off the Swing event dispatch thread (EDT).
|
|
32
|
-
*
|
|
33
|
-
* @author hansi
|
|
34
|
-
*/
|
|
35
|
-
public class JAppleMenuBar {
|
|
36
|
-
static JAppleMenuBar instance;
|
|
37
|
-
static final String FILENAME = "libjAppleMenuBar.jnilib";
|
|
38
|
-
|
|
39
|
-
static {
|
|
40
|
-
try {
|
|
41
|
-
File temp = File.createTempFile("processing", "menubar");
|
|
42
|
-
temp.delete(); // remove the file itself
|
|
43
|
-
temp.mkdirs(); // create a directory out of it
|
|
44
|
-
temp.deleteOnExit();
|
|
45
|
-
|
|
46
|
-
File jnilibFile = new File(temp, FILENAME);
|
|
47
|
-
InputStream input = JAppleMenuBar.class.getResourceAsStream(FILENAME);
|
|
48
|
-
if (input != null) {
|
|
49
|
-
if (PApplet.saveStream(jnilibFile, input)) {
|
|
50
|
-
System.load(jnilibFile.getAbsolutePath());
|
|
51
|
-
instance = new JAppleMenuBar();
|
|
52
|
-
|
|
53
|
-
} else {
|
|
54
|
-
sadness("Problem saving " + FILENAME + " for full screen use.");
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
sadness("Could not load " + FILENAME + " from core.jar");
|
|
58
|
-
}
|
|
59
|
-
} catch (IOException e) {
|
|
60
|
-
sadness("Unknown error, here's the stack trace.");
|
|
61
|
-
e.printStackTrace();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
static void sadness(String msg) {
|
|
67
|
-
System.err.println("Full screen mode disabled. " + msg);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// static public void show() {
|
|
72
|
-
// instance.setVisible(true);
|
|
73
|
-
// }
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
static public void hide() {
|
|
81
|
-
instance.setVisible(false, false);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
* @param visibility
|
|
87
|
-
* @param kioskMode
|
|
88
|
-
*/
|
|
89
|
-
public native void setVisible(boolean visibility, boolean kioskMode);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// public void setVisible(boolean visibility) {
|
|
93
|
-
// // Keep original API in-tact. Default kiosk-mode to off.
|
|
94
|
-
// setVisible(visibility, false);
|
|
95
|
-
// }
|
|
96
|
-
}
|
|
Binary file
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
package monkstone.complex;
|
|
2
|
-
|
|
3
|
-
import java.util.Objects;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The purpose of this class is to to make Complex operations more efficient
|
|
7
|
-
* than JRuby RubyComplex, by having a simpler interface, only modest
|
|
8
|
-
* improvements were obtained (but this is better than nothing on RaspberryPI).
|
|
9
|
-
*/
|
|
10
|
-
public final class JComplex {
|
|
11
|
-
|
|
12
|
-
private final double re; // the real part
|
|
13
|
-
private final double im; // the imaginary part
|
|
14
|
-
private final static JComplex ZERO = new JComplex(0, 0);
|
|
15
|
-
private final static JComplex NAN = new JComplex(Double.NaN, Double.NaN);
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* create a new object with the given real and imaginary parts
|
|
19
|
-
*
|
|
20
|
-
* @param real
|
|
21
|
-
* @param imag
|
|
22
|
-
*/
|
|
23
|
-
public JComplex(double real, double imag) {
|
|
24
|
-
re = real;
|
|
25
|
-
im = imag;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @return a string representation of the invoking Complex object
|
|
30
|
-
*/
|
|
31
|
-
@Override
|
|
32
|
-
public String toString() {
|
|
33
|
-
return "JComplex(" + re + ", " + im + "i)";
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @return abs/modulus/magnitude
|
|
39
|
-
*/
|
|
40
|
-
public final double abs() {
|
|
41
|
-
return Math.hypot(re, im);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* @return square of abs/modulus/magnitude
|
|
47
|
-
*/
|
|
48
|
-
public final double abs2() {
|
|
49
|
-
return re * re + im * im;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* @return angle/phase/argument, normalized to be between -pi and pi
|
|
55
|
-
*/
|
|
56
|
-
public final double phase() {
|
|
57
|
-
return Math.atan2(im, re);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* @param b
|
|
63
|
-
* @return a new Complex object whose value is (this + b)
|
|
64
|
-
*/
|
|
65
|
-
public final JComplex add(JComplex b) {
|
|
66
|
-
JComplex a = this; // invoking object
|
|
67
|
-
double real = a.re + b.re;
|
|
68
|
-
double imag = a.im + b.im;
|
|
69
|
-
return new JComplex(real, imag);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
*
|
|
74
|
-
* @param scalar
|
|
75
|
-
* @return a new Complex object whose value is (this + scalar)
|
|
76
|
-
*/
|
|
77
|
-
public final JComplex add(double scalar) {
|
|
78
|
-
return new JComplex(re + scalar, im);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public final boolean zero() {
|
|
82
|
-
return this.equals(ZERO);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
* @param b
|
|
88
|
-
* @return a new Complex object whose value is (this - b)
|
|
89
|
-
*/
|
|
90
|
-
public final JComplex sub(JComplex b) {
|
|
91
|
-
JComplex a = this;
|
|
92
|
-
double real = a.re - b.re;
|
|
93
|
-
double imag = a.im - b.im;
|
|
94
|
-
return new JComplex(real, imag);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
*
|
|
99
|
-
* @param scalar
|
|
100
|
-
* @return a new Complex object whose value is (this - scalar)
|
|
101
|
-
*/
|
|
102
|
-
public final JComplex sub(double scalar) {
|
|
103
|
-
return new JComplex(re - scalar, im);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
108
|
-
* @param b
|
|
109
|
-
* @return a new Complex object whose value is (this * b)
|
|
110
|
-
*/
|
|
111
|
-
public final JComplex mul(JComplex b) {
|
|
112
|
-
JComplex a = this;
|
|
113
|
-
double real = a.re * b.re - a.im * b.im;
|
|
114
|
-
double imag = a.re * b.im + a.im * b.re;
|
|
115
|
-
return new JComplex(real, imag);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Also known as scale
|
|
120
|
-
*
|
|
121
|
-
* @param b
|
|
122
|
-
* @return a new Complex object whose value is (this * b)
|
|
123
|
-
*/
|
|
124
|
-
public final JComplex mul(double b) {
|
|
125
|
-
return new JComplex(re * b, im * b);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
*
|
|
130
|
-
* @return a new Complex object whose value is the conjugate of this
|
|
131
|
-
*/
|
|
132
|
-
public final JComplex conjugate() {
|
|
133
|
-
return new JComplex(re, -im);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
*
|
|
138
|
-
* @return a new Complex object whose value is the reciprocal of this
|
|
139
|
-
*/
|
|
140
|
-
private JComplex reciprocal() {
|
|
141
|
-
double scale = re * re + im * im; // self dot product
|
|
142
|
-
return new JComplex(re / scale, -im / scale);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
*
|
|
147
|
-
* @param other
|
|
148
|
-
* @return this^other
|
|
149
|
-
*/
|
|
150
|
-
public final JComplex pow(JComplex other) {
|
|
151
|
-
if (this.zero()) {
|
|
152
|
-
if (other.zero()) {
|
|
153
|
-
return ZERO;
|
|
154
|
-
}
|
|
155
|
-
return NAN;
|
|
156
|
-
}
|
|
157
|
-
return (this).log().mul(other).exp();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
*
|
|
162
|
-
* @param scalar
|
|
163
|
-
* @return this^scalar
|
|
164
|
-
*/
|
|
165
|
-
public final JComplex pow(double scalar) {
|
|
166
|
-
if (this.zero()) {
|
|
167
|
-
if (scalar == 0) {
|
|
168
|
-
return ZERO;
|
|
169
|
-
}
|
|
170
|
-
return NAN;
|
|
171
|
-
}
|
|
172
|
-
return (this).log().mul(scalar).exp();
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
*
|
|
177
|
-
* @return log
|
|
178
|
-
*/
|
|
179
|
-
private JComplex log() {
|
|
180
|
-
return new JComplex(Math.log(abs()), Math.atan2(im, re));
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
*
|
|
185
|
-
* @return real part
|
|
186
|
-
*/
|
|
187
|
-
public final double re() {
|
|
188
|
-
return re;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
*
|
|
193
|
-
* @return imaginary part
|
|
194
|
-
*/
|
|
195
|
-
public final double im() {
|
|
196
|
-
return im;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
*
|
|
201
|
-
* @param b
|
|
202
|
-
* @return a / b
|
|
203
|
-
*/
|
|
204
|
-
public final JComplex div(JComplex b) {
|
|
205
|
-
JComplex a = this;
|
|
206
|
-
return a.mul(b.reciprocal());
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
*
|
|
211
|
-
* @param b
|
|
212
|
-
* @return a / b
|
|
213
|
-
*/
|
|
214
|
-
public final JComplex div(double b) {
|
|
215
|
-
if (b == 0) {
|
|
216
|
-
return NAN;
|
|
217
|
-
}
|
|
218
|
-
return new JComplex(re / b, im / b);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
*
|
|
223
|
-
* @return a new Complex object whose value is the complex exponential of
|
|
224
|
-
* this
|
|
225
|
-
*/
|
|
226
|
-
public final JComplex exp() {
|
|
227
|
-
return new JComplex(Math.exp(re) * Math.cos(im), Math.exp(re) * Math.sin(im));
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
@Override
|
|
231
|
-
public final int hashCode() {
|
|
232
|
-
return Objects.hash(re, im);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
@Override
|
|
236
|
-
public final boolean equals(Object obj) {
|
|
237
|
-
if (this == obj) {
|
|
238
|
-
return true;
|
|
239
|
-
}
|
|
240
|
-
if (obj == null) {
|
|
241
|
-
return false;
|
|
242
|
-
}
|
|
243
|
-
if (getClass() != obj.getClass()) {
|
|
244
|
-
return false;
|
|
245
|
-
}
|
|
246
|
-
final JComplex other = (JComplex) obj;
|
|
247
|
-
if (Double.doubleToLongBits(this.re) != Double.doubleToLongBits(other.re)) {
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
return Double.doubleToLongBits(this.im) == Double.doubleToLongBits(other.im);
|
|
251
|
-
}
|
|
252
|
-
}
|