It is currently Thu Mar 28, 2024 10:15 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
Offline
 Post subject: Diagram difference with SL
Post #1 Posted: Thu Mar 28, 2013 5:23 am 
Gosei
User avatar

Posts: 2011
Location: Groningen, NL
Liked others: 202
Was liked: 1087
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
While developing my diagram builder, I noticed that Life in 19x19 renders handicap points differently than Sensei's Library. Some more research shows that this is related to how circles are drawn.

Here's how L19 renders

Click Here To Show Diagram Code
[go]$$B
$$.,TCSM?,|
$$OXBWAV*,|
$$--------+[/go]


Here's how SL renders:

Image

The handicap point difference is the most noticable, but actually all circle shapes, including stone outlines, are slightly different.

Handicap points, for example, are made by drawing three concentric circles with diameter 6,5 and 4.

Here's the pixels SL chooses:

Image

which are these:

Click Here To Show Diagram Code
[go]$$B
$$ . . . X . . .
$$ . X X X X X .
$$ . X X X X X .
$$ X X X . X X X
$$ . X X X X X .
$$ . X X X X X .
$$ . . . X . . .[/go]


And here's the pixels L19 chooses:

Click Here To Show Diagram Code
[go]$$B
$$ . . . . .
$$ . + + + .
$$ . + , + .
$$ . + + + .
$$ . . . . .[/go]


which are these:

Click Here To Show Diagram Code
[go]$$B
$$ . . X X X . .
$$ . X . X . X .
$$ X . X . X . X
$$ X X . . . X X
$$ X . X . X . X
$$ . X . X . X .
$$ . . X X X . .[/go]


This isn't really important, of course, either result is understandable by the readers. I like the SL result slightly better, as it seems strange to have empty space inside handicap points :)

I think this is caused by how PHP's ImageArc function decides on which pixels to draw. Whereas the SL version of PHP seems to choose the closest lower pixel by distance, L19's PHP version seems to just choose the closest. E.g. with a circle of diameter 6, so radius 3, which Y corresponds to X=1 given pythagoras' X2 + Y2 = Z2? There are two candidates: Y=2 gives sqrt(12 + 22) = sqrt(5) = 2.236. Y=3 gives sqrt(12 + 32) = sqrt(10) = 3.162. SL's version of PHP chooses Y=2 (closest value not over 3), whereas L19's PHP chooses Y=3 (closest value).

I thought I'd document it here in case people wonder why the diagrams they get here look slightly different than the ones that my diagram builder seems to promise ;)


This post by HermanHiddema was liked by: jts
Top
 Profile  
 
Offline
 Post subject:
Post #2 Posted: Fri Mar 29, 2013 11:56 pm 
Honinbo
User avatar

Posts: 8859
Location: Santa Barbara, CA
Liked others: 349
Was liked: 2076
GD Posts: 312
HermanHiddema wrote:
sqrt(10) = 3.162. SL's version of PHP chooses Y=2 (closest value not over 3)
But 3 is the "closest value not over 3", is it not?
Unless by "not over 3" you mean "not equal to 3 or over," which means "less than 3" ?

Top
 Profile  
 
Offline
 Post subject: Re:
Post #3 Posted: Sat Mar 30, 2013 2:24 am 
Gosei
User avatar

Posts: 2011
Location: Groningen, NL
Liked others: 202
Was liked: 1087
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
EdLee wrote:
HermanHiddema wrote:
sqrt(10) = 3.162. SL's version of PHP chooses Y=2 (closest value not over 3)
But 3 is the "closest value not over 3", is it not?
Unless by "not over 3" you mean "not equal to 3 or over," which means "less than 3" ?


I meant the closest value where the result of sqrt(X2 + Y2) is not over three.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group