pspace.org

  • Increase font size
  • Default font size
  • Decrease font size

How to plot colour-coded functions in Java

E-mail Print PDF

This is a very simple Java programme I wrote for my extended project in maths because I couldn't find any programme that does this. It plots a two-dimensional function of the type f(x,y)=z using a colour code (high values have a brighter colour than low values) and saves the result to an image. I used it for f(x,y)=sin(x2+y2), which looks pretty nice.

The settings in the code are explained through comments, you'll have to try different values for other functions than the one I just described, I just uploaded the code in case anyone can use it. Maybe I'll turn it into a real application and/or applet some time, too.

Example plot for sin(x^2+y^2)

Download Source (JAVA-File, 3 KB)

Last Updated on Thursday, 27 May 2010 21:38  

Most recent entries

Fun with Sturm chains

22/01/2012 | 3_of_8 I recently did a seminar on decision procedures, and my talk was on Tarski's decision procedure for first-order real arithmetic. Basically, the problem is that you have a formula with real variables ...
More...

Distributed Hash Tables (DHT) in Peer to Peer Networks (German)

17/12/2011 | inherited Two years ago, I had to write a paper like thing at school on any subject, so we (me and a classmate) chose Distributed Hash tables in Peer to Peer Networks. Long story short, they are used to accel...
More...

The Untyped Lambda Calculus

19/08/2011 | 3_of_8 I just remembered a talk I did on Alonzo Church's Untyped Lambda Calculus earlier this year. (they call it a "Proseminar") The Lambda Calculus is a very simple but turing-complete functional model ...
More...

Protocols of Physics Lab Course at University of Göttingen (German)

01/08/2011 | inherited Here's a list of our physics lab course protocols (http://www.praktikum.physik.uni-goettingen.de), which we started at summer semester 2011 in Göttingen. The list is incomplete, as not all of the p...
More...

3D fieldlines

12/05/2011 | inherited For a physics project at university, I had to calculate and plot fieldlines in three dimensions. I wrote a little tool to do the math and show them with OpenGL. I will publish it soon, until then, hav...
More...