| | |
Calculating distance between pixels
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
ever heard of Pythagoras' Theorem " a on power of two plus b on power of two equals to c on power of two"?
just example
just example
(x1 - x2 ) = x // your a (y1 - y2) = y // your b if ( x < 0) then x * (-1) if ( y < 0) then y * (-1) x^2 + y^2 = z^2 // z is your c distance between pixels this ^2 on power of two then get square root
Last edited by peter_budo; Nov 17th, 2006 at 7:39 am.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
•
•
ever heard of Pythagoras' Theorem " a on power of two plus b on power of two equals to c on power of two"?
just example
(x1 - x2 ) = x // your a (y1 - y2) = y // your b if ( x < 0) then x * (-1) if ( y < 0) then y * (-1) x^2 + y^2 = z^2 // z is your c distance between pixels this ^2 on power of two then get square root
yeah that's correct forgot about it :mrgreen:
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
Other Threads in the Java Forum
- Previous Thread: Convert an image to *.ico format
- Next Thread: Adding mouse listener to a frame
| Thread Tools | Search this Thread |
2dgraphics android api apple applet application arguments array arrays automation banking binary binarytree bluetooth capture chat chatprogramusingobjects class classes client code color component count database derby design eclipse eclipsedevelopment encryption error exception fractal game givemetehcodez graphics gridlayout gui html ide if_statement image input integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel julia keyword linux list loop macintosh map method methods midlethttpconnection mobile netbeans newbie nullpointerexception object os print printing problem producer program programming project projectideas read recursion reference replaysolutions ria scanner screen server set size sms sort sourcelabs sql stop string swing threads transforms tree ui unicode validation windows






