This week's book giveaway is in the Testing forum.We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line!See this thread for details.
Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!

# How to plot this contour ?

motress zlting
Ranch Hand
Posts: 55
Im doing detection of access point signal strength ....but i now don't know how to plot contour ....
Can anyone tell me how to plot this shown in that image ?
I have the signal data collected at different place.
contour.jpg

Ulf Dittmer
Rancher
Posts: 42968
73
I'm guessing that the problem is not so much doing the actual drawing (which, using the Graphics and Graphics2D classes, should not be too hard) but figuring out where to draw the contour lines; is that correct?

The first step would be to classify the measurements into groups of similar signal strength - between those the contour lines would be drawn. For example, if signal strength is measured by a number between 0 and 100, then there's a group for maybe signals strengths > 75 right around the AP point, another group for maybe signal strengths > 50 further out, a third group fro strengths > 25 even further out, and a forth group for everything below that. With those 4 groups, you'd get the 3 dividing lines seen in the picture.

motress zlting
Ranch Hand
Posts: 55
Ulf Dittmer wrote:I'm guessing that the problem is not so much doing the actual drawing (which, using the Graphics and Graphics2D classes, should not be too hard) but figuring out where to draw the contour lines; is that correct?

The first step would be to classify the measurements into groups of similar signal strength - between those the contour lines would be drawn. For example, if signal strength is measured by a number between 0 and 100, then there's a group for maybe signals strengths > 75 right around the AP point, another group for maybe signal strengths > 50 further out, a third group fro strengths > 25 even further out, and a forth group for everything below that. With those 4 groups, you'd get the 3 dividing lines seen in the picture.

But for now i even don't know how to plot the first line .....
Can you teach me ?
Let say i set the first line as -65dbm which is strong signal, and i gonna how to draw it (the circle line) ?

salvin francis
Bartender
Posts: 1320
10

Have you looked at java 2d api ?

http://java.sun.com/products/java-media/2D/index.jsp

Also check your java installation folder for the following program:

/demo/jfc/Java2D/Java2Demo.jar

run it and check the output

motress zlting
Ranch Hand
Posts: 55
salvin francis wrote:
Have you looked at java 2d api ?

http://java.sun.com/products/java-media/2D/index.jsp

Also check your java installation folder for the following program:

/demo/jfc/Java2D/Java2Demo.jar

run it and check the output

but it is not a complete circle....., it must have surge....that is the difficult part, im headache with this problem.

salvin francis
Bartender
Posts: 1320
10
motress zlting
I suggest you go through the api first.

motress zlting
Ranch Hand
Posts: 55
salvin francis wrote:motress zlting
I suggest you go through the api first.

does it need any plugin ?

salvin francis
Bartender
Posts: 1320
10
no

David Newton
Author
Rancher
Posts: 12617
You're going to have to be more specific about the actual problem you're having.

So far it looks like you don't know how to draw a smooth line given a limited set of data points. There are an arbitrary number of ways to do that--which works best for you can only be decided by you. If this is the problem, search the web for various line-drawing algorithms and pick which one you think works best.

motress zlting
Ranch Hand
Posts: 55
David Newton wrote:You're going to have to be more specific about the actual problem you're having.

So far it looks like you don't know how to draw a smooth line given a limited set of data points. There are an arbitrary number of ways to do that--which works best for you can only be decided by you. If this is the problem, search the web for various line-drawing algorithms and pick which one you think works best.

Let say i just want to draw the first line,
how can i set a point (access point) on an image ?
if i have only one data which is at distance=12m, signal strength=-68dbm, how am i going to plot for the first line ?

David Newton
Author
Rancher
Posts: 12617
If you only have one data point, you're not going to be drawing any lines.

motress zlting
Ranch Hand
Posts: 55
David Newton wrote:If you only have one data point, you're not going to be drawing any lines.

Then 3 data will do ?