As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
If I have a 2x2 image (with the following pixel colors below), and am rotating the pixels counterclockwise by 90 degrees, what would the new arrangement be?
{Pixel.BLACK, Pixel.BLUE},
{Pixel.RED, Pixel.GREEN}
I know this is a simple question, but my test case keeps on failing and I am guessing that perhaps my logic may be incorrect.
BLUE, GREEN
BLACK, RED
If your coordinates were rows.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am trying to create an image that contains nodes (represented as rectangles) and a path. Two consecutive nodes in the path should be connected with a directed edge (line and an arrowhead at the end). Each line should start at the center of a rectangle and point towards the center of the next rectangle in the path.
The question is whether there is any easy way to calculate the point where each arrow hits the rectangle. Rectangles are not necessarily aligned horizontally and/or vertically, so this is not trivial.
I have managed to come up with a solution that works quite well, but I had to remember all the geometry I was taught at school. Maybe there is an easier way to do it with rotations, instead of calculating directly the end point?
In this example, the endpoints coincide with the centers of the connected rectangles; this obviates the need to calculate the intersection explicitly.
A similar approach is taken in the example cited here, using symmetric shapes.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
In Actionscript and 3D systems, the Y axis increases upwards (bottom is either 0 or -1, and top is usually 1). This convention makes sense relative to the real world. However in languages such as Java, the convention is flipped (bottom is 1, and top is 0 or -1). I've always wondered: Why?
Thanks! :)
In 2D software, the y-direction is typically downwards - top left corner of the screen is the origin. The first screens were text only, and you would number text lines from the top. This numbering system stuck.
In 3D software, many libraries choose to implement Y as up, but only because, as you've mentioned, that "makes more sense".
This is not a feature of the "language". It's a feature of the library.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are good libraries to create a Contour plot in Java?
The class ContourPlot in JFreeChart is deprecated, and a reference is made to the XYBlockRenderer class.
I would like to have some suggestions.
The closest thing I could find is Jzy3D.
In their gallery is a chart with the title "Filled Contour Demo (2d picture)".
Maybe this would be a starting point.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need to represent quite some data for which a cube grid would just make perfect sense. Does such a thing exist for Swing?
A "cube grid" looks like this (and it's really darn impressive):
http://www.smartclient.com/smartgwtee/showcase/#cube_analytics
You can try JIDE Pivot table. I think it is pretty close to what you need.
More info at http://www.jidesoft.com/products/pivot.htm
Try out the free and simple Java swing component https://github.com/aristsoft/jpivot to visualize the data in multidimentional view.
It designed just to show the data, so it don't doing the data aggregation any kind itself.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Are there any good books that teach how to make simple physics simulations in Java?
Yes, I recommend you this one: http://www.amazon.com/Physics-Game-Programmers-Grant-Palmer/dp/159059472X
Also you can check a lot of physics for games developed in Java:
http://www.amazon.com/Developing-Games-Java-David-Brackeen/dp/1592730051
http://javapdfbooks.blogspot.com/2009/07/physics-for-game-programmers.html ('free')
Physics for Game Developers (is in C++)
I hope that this helps you!