I am going through Java AWT & Swings and came to know on how to create the basic GUI elements and I was able to work on some programs with it. But when I am trying to understand how to create Graphs for some complex mathematical equations then I was not able to find some documentation or any examples.
For example, in this post - How to solve the trigonometric equation cos(πθ/β)−cos(2πθ/β)=0?
the user has given some complex equation and also shown how the graphs looks like.
But how can we write a Java program for this equation that generates the graph GUI as output?
Can someone please point me to some documentation or links so that I can understand how to achieve this in Java?
Thanks in advance.
I had similar question on this, go through these links to understand how to create the GUI in Java:
Java Swing GUI for equation 5((θ/β) - cos(2πθ/β))
Java Swing GUI for equation 5((θ/β) - cos(2πθ/β)) - to draw continuous graph
Related
I have a table with the following structure:
[relation, variable1, variable2]
I would like to visualize those relation over a triangular matrix, something like this but with any number of variables and not only 4. Is there any free java library to do so? any ideas on how to visualize it by my own?
I don't have any code yet, Just thinking about the idea and process of how doing it.
much appreciation to all :)
I suggest you use a Swing framework that is natively provided by Java so you don't have to import any external library for this task.
I think painting this matrix (as in your link) is not difficult using Swing.
I find this discussion very useful for your case How to draw grid using swing class Java and detect mouse position when click and drag
Because it provides an example of painting a matrix.
I am writing a game in Java but have run in to an issue. I need to blur certain entitities within the game in order to create the right look. However, a lot of these objects are circular and so I am having issues blurring them properly.
Here is an example of the kind of thing I'm aiming for:
Currently, I'm using a box blur but just can't think of a way to achieve this sort of effect.
If somebody could give me a nudge in the direction I need to be looking that would be great.
Thanks.
Will
I searched a bunch of websites to find a working example of how to create a Voronoi based 3D Box.
The following link shows you guys for what i am looking for. Can someone help me out with this?
I created "Seedpoints" in a 3D Box and now what? ... couldn´t find a good and simple example on openprocessing either.
Thank you in advance.
Picture
I think Voro++ is doing exactly what you want. However, it is written in C++ but creating a small wrapper using swig for example will provide you a java binding.
You can start with 2D texture created by processing library Mesh (just use getEdges() function to draw border lines of regions) and use it with texture mapping on your 3D box.
Voronoi diagrams can be easily handled with pixel shaders depending on the format of your seed points This example is the best I've found so far but it relies upon points whose coordinates are computed inside the shader, at least to my understanding.
I'm currently trying to think of a way to plot a graph in Java.
The basic way my program is meant to work is it finds a users .csv file and in there will be some sort of habit and the date. So like drove 5 miles on 24.10.13.
So I need to be able to extract the 5 and the 24.10.13 and take those as my Y and X co-ordinates respectively as other things are measured against date and it makes sense to have that as the X value.
So is there a library I can import or a Function I'm not aware of and could you give a simple example on how to use it?
NOTE - I've done my GUI in JavaFX as I'm not that great in JFrame and I know nothing of Swing
JavaFX has built-in charts. You may check it out. That way, you won't need any external libraries.
How about using JFreeChart to plot your data? You can see some samples here. JGraph seems to be geared towards visualizing graphs, not for plotting functions.
It will look something like this:
I'm wondering what the best way of going about this is, with regard to making the GUI (Swing vs. OpenGL) and any other issues you can think of.
I'm not wedded to making it 3-D, as I could just show two-sides and the bottom, but I'd love any advice.
Take a look at the Kube sample in the SDK. It implements an OpenGL Rubix cube (motion only, no input).