Tuesday, April 28, 2009

Inversion 1.3

I have updated Inversion to version 1.3. What has changed with this version is that you can export as text, png and tiff. (Find it under File > Export) I hope you can find this update useful. BTW the exported images show what you can see in the window.

Chagelog:

  • Added exporting options (text, png and tiff)

Download:

Inversion 1.3,dmg
Source.zip

System requirements

  • Mac OS X 10.5 or later
  • 1.5 MB free disk space

Example for exported png:

Export sample

Example for exported txt:

Given objects:
Cirle - r: 12.000000, center: point( 50.000000 | 30.000000 )
Cirle - r: 12.000000, center: point( 50.000000 | 20.000000 )
Cirle - r: 12.000000, center: point( 34.538287 | 28.296654 )

Solutions:
Cirle - r: 20.826605, center: point( 42.726146 | 25.000000 )
Cirle - r: -3.173395, center: point( 42.726146 | 25.000000 )
Cirle - r: -6.363027, center: point( 52.602972 | 25.000000 )
Cirle - r: 7.369658, center: point( 31.286805 | 25.000000 )
Cirle - r: 4.118702, center: point( 43.815119 | 15.115115 )
Cirle - r: -3.322336, center: point( 41.847730 | 32.973607 )
Cirle - r: -4.984636, center: point( 49.145481 | 36.963126 )
Cirle - r: 2.065743, center: point( 40.065832 | 20.042218 )

7 comments:

lone said...

Hi Lukas !! I am new in Objective C and went through alot of tutorials so that I can understand your code, but I am still unable to find the place where all the control is taking place, means upon completion of three circles which class gets called and then how it computes the solution afterwards. I would be grateful if you help me with finding the controller class.

Looking forward for your answer

Regards

Lukas Berns said...

Hello Ione
Sorry about that. I didn't leave comments for that in the code…
it's actually very simple

It's like this:

——ObjC-Code—————————————————
// create three circles
IVSCircle *c1 = [IVSCircle circleWithX:10 y:10 radius:10];
IVSCircle *c2 = [IVSCircle circleWithX:20 y:30 radius:4];
IVSCircle *c3 = [IVSCircle circleWithX:40 y:6 radius:7];

// store them in an IVSMutableArray
IVSMutableArray *circles = [IVSMutableArray array];
[circles addObject:c1];
[circles addObject:c2];
[circles addObject:c3];

// get the solutions (also an IVSMutableArray)
IVSMutableArray *solutions = [circles arrayOfCirclesTouching];

// you can acces the circles like this:
IVSCircle *aCircle = [solutions objectAtIndex:0];
—————————————————————————

You might need to adjust IVSPrecision to get proper results. (I think around 10^6 or 10^9 is fine)

I am currently porting this to Java. That showed me how bad the code design is.
E.g. you have to check afterwards, if an object touches all circles externally, or c1 ex., c2 and c3 internally etc.

I hope this helps ;)
Lukas

lone said...

Hi Lukas thanks for the response, I have been coding in Java for almost past six years or so, do let me know if you want anything in that, I would be grateful if I am to any use to you

Best of luck

Lukas Berns said...

I made a github repo for the Java port.
If you have interest, you can check it out and help me.
The current version doesn't give correct results — I don't know why…

http://github.com/lukasberns/Apollonius/tree/master

Thanks
Lukas

Anonymous said...

Hi Lukas I checked out the code from SVN today, You havent shared any document specifying the logic you have used. When compared with objective-c code it is missing one entry (Cirle - r: 9.343380, center: point( 28.687836 | 31.153929 )) for the default values you have set in the main file. Is there a way to talk you on skype or email

Lukas Berns said...

@Anonymous

Hi
you can Skype me at “lukas-berns”
(but I'm seldom online, so the best would be of you contact me in the next few hours)
Cheers Lukas

Lukas Berns said...

Hi Anonymous

I updated “Apollonius”. Now you can input circles from the console. Like this:

$ java apollonius.Apollonius --render circle[30,32,13] circle[40,25,4] circle[28,37,9]

I don't think you meant this with “logic”, but I thought it would be convenient.
If what you meant with logic is the identification of the solution circles (if they are touching all circles internally or only circle 1 and 2…), you can check that with the touchesCircleInternally(Circle) method of the circle class.

Just be careful: It's still buggy.

Cheers
Lukas