I am doing some research in the field of pseudo-random numbers. Generating and testing.
Now, I want to write programs with a GUI for visualization of such numbers and/or tests.
>Pick 3 random numbers x,y,z from self written generator
>Let (xyz) be a point in a sphere
>do it 100+ times
>look at the sphere, rotate, zoom, etc
I can write the functional Code in C. But I have not done any GUI programming yet.
All I need is a toolkit like gtk or some other solution to get x,y,z out of my C program in a visual coordinate system, or sphere or whatever.
Help would be awesome, I need this for a Thesis.
+ if it is compatible with Mac (is not a must, I use GNU/Linux too)
+ if I can use my C Code
+ if I can learn it within 1-2 months
Thank you all in advance.
If you want to actually do 3D rendering of something it would probably be best to do it with some lib that can do the heavy lifting for you, I suppose you wouldn't want to handle shit like projection/rotation/translation by yourself, so maybe use OpenGL.
>I am doing some research in the field of pseudo-random numbers
>Now, I want to write programs with a GUI for visualization of such numbers and/or tests.
I see. Humanities...
I think raw opengl would be fine for what you're doing.
Just drawing co-ordinate points in space right? Pretty simple then just look up some camera transforms to get your panning and rotating. Shouldn't take that long with a nice handful of tutorials.
>>I am a /g/ sheeple and like thinking in boxes
Yeah. Box: if you have an idea for a prng, you should also have an idea for a test that'll give you binary result. Looking at some 3d plot of random numbers will only be meaningful for the most naive prng.
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
p = 2*np.random.rand(3, 1e3)-1
p = p[:, sum(p*p, 0)**.5<= 1]
ax.scatter(p, p, p,s=0.2)
Something like this?
Python with numpy and matplotlib, it's the usual combo for plotting and numerical work.
Yes matplotlib, and that code is interactive, with zoom, pan etc.
You can embed matplotlib in gtk, but I think wx is supported better.
It's very easy to plug in to applications.
This was some serious help, thanks a lot anon.
I guess this is could finally the reason for me to get into python.
2 months for learning Python and NumPy for adapting mathematical RNG into it - realistic?
It's possible, considering you know C.
You should be able to find bunch of examples around internet along with boilerplate code, that's one good part of pythons popularity.
Numpy is peculiar with it's own syntax, which differs little from vanilla python, but it just extends it. Also numpys arrays are much more versatile and "magic" compared to pythons lists, they inherently support almost all numpy functions. So you can do really condensed stuff, like the code I posted.
Here's a good free book for Python that I suggest for people who already now some programming.