Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How to find the pixels of that line which is crossing the circle? Is there any formula? Iam getting the line's end pointscircle

share|improve this question

migrated from stackoverflow.com Nov 14 '12 at 13:14

This question came from our site for professional and enthusiast programmers.

1  
do you know the centre of the circle ? –  shamis Nov 14 '12 at 12:00
    
yeah, I know the centre and radius of the circle. –  Dev Nov 14 '12 at 12:05
    
You could fine the area of that particular sector with the angle formed on the centre. Now you just have to find the area of the whole circle and subtract the sectors area. Hope you got it. –  shamis Nov 14 '12 at 12:16
    
What line? What data do you have? Area of the circle, or 'pixels of the line' (whatever that might mean)? Not a real question. –  EJP Nov 14 '12 at 12:21

2 Answers 2

What you have outside the line is a Circular Segment. If $R$ is the radius of the circle and $\theta$ is the full angle at the center, the area is $\frac {R^2}2(\theta - \sin \theta)$. Presumably the $\frac 34^\text{th}$ in your title means this is $\frac 14$ of the circle, you can solve numerically to find $\theta \approx 2.31$ radians. Nothing you have given allows the determination of the end points, as the figure can be rotated around the center. Your figure has the segment much less than $\frac 14$ of the circle.

share|improve this answer

The arc on one side of the line seems to be $90^\circ=\frac\pi2=\frac14\text{ circumference}$. So the arc is a "circle minus $\frac34$". The area of the bit of the circle to the upper left of the line (in red), would be $\frac14$ the area of the circle minus the area of the green triangle.

$\hspace{5cm}$enter image description here

That is, the area of the red piece is $$ \frac14\pi r^2-\frac12r^2=\frac14(\pi-2)r^2 $$

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.