[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Hello /g/, I am doing some research in the field of pseudo-random
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 21
Thread images: 2
File: noise-sphere-002.jpg (69 KB, 800x550) Image search: [Google]
noise-sphere-002.jpg
69 KB, 800x550
Hello /g/,

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.

For example:

>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.
>>
>>44690568
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.
>>
bump I guess
>>
>>44690568
>I am doing some research in the field of pseudo-random numbers
Ooh, interesting...
>Now, I want to write programs with a GUI for visualization of such numbers and/or tests.
Oh. No.
>Thesis
>Mac
I see. Humanities...
>>
>>44690653
>handle shit like projection/rotation/translation by yourself, so maybe use OpenGL
You mean GLM. Nobody uses those outdated glTransform, etc. Functions.
>>
>>44690684

>I am a /g/ sheeple and like thinking in boxes
>>
>>44690653

Thanks, I will look into OpenGL. Any useful tutorials?

>>44690698

by outdated, do you mean slow or not useful or critical from a security perspective?
>>
Also, do any of you work on this kind of stuff?
>>
>>44690780
Raw OpenGL is still pretty low level and hard to get the hang of.
I'd use something like SDL2 maybe, or some other graphics library.
>>
Just for curiosity.. is there another, yet better way than using C + Libraries?

Like Mathematica, Matlab or some other kind of stuff? All-in-One Solutions?
>>
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.
>>
>>44690719
>>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.
>>
Sounds like an interesting project. If you make progress, be sure to post it here. I'd love to take a look.
>>
>>44691123

Yes, but my intention is to make a model in form of a sphere so others can understand it better. Thats why I am writing a Thesis about it. It is not for me, it is for others.
>>
>>44691185

Thank you, I will keep you guys updated. Thesis should be ready in february and have to iron my LATEX, OpenGL and C skills until Jan.
fun ride!
>>
File: figure_1.png (74 KB, 800x600) Image search: [Google]
figure_1.png
74 KB, 800x600
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[0], p[1], p[2],s=0.2)
plt.show()

Something like this?
>>
>>44691414

Exactly. So this is Python and which Library?
>>
>>44691414

Just saw it, mathplotlib right?

But the problem here is, that I does not give me interaction. allthough this would look neat on paper
>>
>>44691448
Python with numpy and matplotlib, it's the usual combo for plotting and numerical work.

>>44691494
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.
>>
>>44691676

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?
>>
>>44691788
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.
http://www.greenteapress.com/thinkpython/
Thread replies: 21
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.