Click here to Skip to main content
15,883,894 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Boundless Binary Search Pin
Igor van den Hoven6-Sep-14 10:04
Igor van den Hoven6-Sep-14 10:04 
GeneralRe: Boundless Binary Search Pin
harold aptroot6-Sep-14 11:10
harold aptroot6-Sep-14 11:10 
GeneralRe: Boundless Binary Search Pin
Igor van den Hoven6-Sep-14 12:32
Igor van den Hoven6-Sep-14 12:32 
GeneralRe: Boundless Binary Search Pin
harold aptroot6-Sep-14 12:52
harold aptroot6-Sep-14 12:52 
GeneralRe: Boundless Binary Search Pin
Igor van den Hoven6-Sep-14 15:07
Igor van den Hoven6-Sep-14 15:07 
GeneralRe: Boundless Binary Search Pin
harold aptroot6-Sep-14 20:25
harold aptroot6-Sep-14 20:25 
AnswerRe: Boundless Binary Search Pin
Alan Balkany5-Nov-15 0:21
Alan Balkany5-Nov-15 0:21 
QuestionSurface calculation (sphere) - projection effect. [SOLVED ?] Pin
V.3-Aug-14 22:31
professionalV.3-Aug-14 22:31 
I want to calculate the surface of an area on a sphere including projection effect.
For this I have a scanned image (which results in a 2D disc). On this image I can highlight an area and I have the index of each pixel of that area relative to the center of that disc (x, y coordinates). I also have the radius (in pixels and meters)

How can I calculate the correction needed for each pixel in order to take in account the projection effect (larger at the edges of the disc)?

Thanks.

[SOLUTION]
It's a pretty long solution, so I'll try to be as brief as possible.
1. You need to scale down the sphere to a unit sphere (radius=1)
2. With that you know that x²+y²+z² = 1 and thus z = sqrt(1-x²-y²) and the surface (of a full sphere) is 4*pi*r² = 4*pi, but you only have half the sphere so S=2*pi
3. What you need is the cosine of the angle of the pixel with the Z-axis. This is the z calculated in step 2 (the sqrt) divided by the radius which you reduced to one.
4. In the end you get this formula for the area per pixel: (1/r² * 1/(2*pi*sqrt(1-x²-y²)) ). If you loop through the pixels of the complete area you just need to to sum up all these pixels.
5. This results in a fraction of the surface compared to the sphere surface which you can then convert to any unit you like.
On first sight this "looks" correct Smile | :)
[/SOLUTION]
V.

(MQOTD rules and previous solutions)


modified 8-Aug-14 7:50am.

AnswerRe: Surface calculation (sphere) - projection effect. [SOLVED ?] Pin
Supreme Master27-Jul-15 9:24
Supreme Master27-Jul-15 9:24 
QuestionLock free algorithms Pin
Joe Woodbury1-Jul-14 8:15
professionalJoe Woodbury1-Jul-14 8:15 
AnswerRe: Lock free algorithms Pin
Michael Gazonda31-Jul-14 18:51
professionalMichael Gazonda31-Jul-14 18:51 
GeneralRe: Lock free algorithms Pin
Joe Woodbury31-Jul-14 19:21
professionalJoe Woodbury31-Jul-14 19:21 
GeneralRe: Lock free algorithms Pin
Michael Gazonda31-Jul-14 19:25
professionalMichael Gazonda31-Jul-14 19:25 
AnswerRe: Lock free algorithms Pin
SledgeHammer016-Sep-14 8:58
SledgeHammer016-Sep-14 8:58 
GeneralRe: Lock free algorithms Pin
Joe Woodbury6-Sep-14 9:50
professionalJoe Woodbury6-Sep-14 9:50 
GeneralRe: Lock free algorithms Pin
SledgeHammer016-Sep-14 11:35
SledgeHammer016-Sep-14 11:35 
GeneralRe: Lock free algorithms Pin
Joe Woodbury6-Sep-14 11:49
professionalJoe Woodbury6-Sep-14 11:49 
GeneralRe: Lock free algorithms Pin
SledgeHammer016-Sep-14 12:55
SledgeHammer016-Sep-14 12:55 
GeneralRe: Lock free algorithms Pin
Joe Woodbury6-Sep-14 13:11
professionalJoe Woodbury6-Sep-14 13:11 
GeneralRe: Lock free algorithms Pin
SledgeHammer016-Sep-14 13:37
SledgeHammer016-Sep-14 13:37 
GeneralRe: Lock free algorithms Pin
Joe Woodbury6-Sep-14 13:44
professionalJoe Woodbury6-Sep-14 13:44 
QuestionAlgorithm for comparing word with randomly distributed substring Pin
asdf2321130-Jun-14 23:06
asdf2321130-Jun-14 23:06 
AnswerRe: Algorithm for comparing word with randomly distributed substring Pin
Sanmayce3-Jul-14 7:15
Sanmayce3-Jul-14 7:15 
AnswerRe: Algorithm for comparing word with randomly distributed substring Pin
Sanmayce5-Jul-14 7:19
Sanmayce5-Jul-14 7:19 
QuestionCubesort Pin
Igor van den Hoven22-Jun-14 4:09
Igor van den Hoven22-Jun-14 4:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.