Generalizing computation of number of pixels in inscribed circle to axis-aligned ellipses at arbitrary points












0












$begingroup$


This answer really nicely sums up the question of how to compute the number of pixels inside an inscribed circle. However, I am looking for a more generalized version of this in two ways.



1) I would like to be able to compute this to handle arbitrary centers (i.e. not the center of a pixel or right on the intersection of 4 pixels)



2) To generalize this to an axis-aligned ellipse inscribed in a $d_h times d_w$ rectangle. That is an ellipse that is symmetric across the y-axis and across the x-axis.



How do I finish the derivation for the odd-number diameter case for circles at an arbitrary center below, and how might I extend this to an inscribed ellipse?





For the matter of arbitrary centers for circles, I believe I have the start below just by slightly modifying the derivation from the linked answer (for a $d times d$ inscribing square with decimal offsets from the centers given by $(mu_x, mu_y)$):




Case I - $d = 2ell + 1$ is odd.



When $d$ is odd, the center of the inscribed circle coincides with the
center of one of the unit squares. The centers of the unit squares lie
on an integer lattice and the number we want is



$$mathcal{N}_{odd}(d) = left| left{; (x,y) in mathbb{Z}^2 :
> sqrt{ x^2 + y^2 } le frac{d}{2} ;right}right|$$




$$mathcal{N}_{odd}(d) = left| left{; (x,y) in mathbb{Z}^2, (mu_x mu_y) in mathbb{R}^2 :
sqrt{ (x - mu_x)^2 + (y-mu_y)^2 } le frac{d}{2} ;right}right|$$




Notice the
lattice points inside the inscribed circle has a $4$-fold rotational
symmetry with respect to the center of $dtimes d$ square. This give
us
$$begin{align} mathcal{N}_{odd}(d) &= 1 + 4 left|left{ (x,y)
in mathbb{Z}^2 : sqrt{ x^2 + y^2 } le frac{d}{2}, x ge 0, y > 0
;right}right|\ &= 1 + 4 sum_{y=1}^ell left|left{ x in
mathbb{Z} : sqrt{ x^2 + y^2 } le frac{d}{2}, x ge 0
;right}right| end{align} $$




$$begin{align} mathcal{N}_{odd}(d) &= 1 + 4 left|left{ (x,y)
in mathbb{Z}^2, (mu_x mu_y) in mathbb{R}^2 : sqrt{ (x-mu_x)^2 + (y-mu_y)^2 } le frac{d}{2}, x ge 0, y > 0
;right}right| \
&= 1 + 4 sum_{y=1}^ell left|left{ x in
mathbb{Z}, (mu_x mu_y) in mathbb{R}^2 : sqrt{ (x-mu_x)^2 + (y-mu_y)^2 } le frac{d}{2}, x ge 0
;right}right| end{align} $$



Although I'm not really sure how to make the leap parallel to this last reduction (I don't understand where the $1$ inside the floor function comes from):




$$ N_{odd}(d) = 1 + 4 sum_{y=1}^ell leftlfloor 1 +
sqrt{left(frac{d}{2}right)^2 - y^2} rightrfloor $$




For the even case, it seems to follow that we simply replace the $frac12$ with the decimal offsets:




Case II - $d = 2ell$ is even.



When $d$ is even, the center of the inscribed circle coincides with
the common corner of 4 unit squares. If we choose a coordinate system
such that this center is the origin, the centers of the unit squares
nows lies on an "half-integer" lattice. ...



One again, the lattice points inside the inscribed
circle has a 4-fold rotation symmetry. This leads to
$$begin{align}
mathcal{N}_{even}(d) &= 4left|left{; (x,y) in mathbb{Z}_h^2 :
sqrt{x^2+y^2} le frac{d}{2}, x > 0, y > 0;right}right|\
&=4sum_{y=1}^ell left|left{; x in mathbb{Z} :
sqrt{(x-frac12)^2+(y-frac12)^2} le frac{d}{2}, x >
0;right}right|\
&= 4sum_{y=1}^ell leftlfloorfrac12 +
sqrt{left(frac{d}{2}right)^2 -
left(y-frac12right)^2}rightrfloor end{align} $$




$$begin{align}
mathcal{N}_{even}(d) &= 4left|left{; (x,y) in mathbb{Z}_h^2, (mu_x mu_y) in mathbb{R}^2 :
sqrt{x^2+y^2} le frac{d}{2}, x > 0, y > 0;right}right|\
&=4sum_{y=1}^ell left|left{; x in mathbb{Z},(mu_x mu_y) in mathbb{R}^2 :
sqrt{(x-mu_x)^2 + (y-mu_y)^2} le frac{d}{2}, x >
0;right}right|\
&= 4sum_{y=1}^ell leftlfloormu_x +
sqrt{left(frac{d}{2}right)^2 -
left(y-mu_yright)^2}rightrfloor end{align} $$










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    There is an infinite number of different ellipses that can be inscribed in a given rectangle.
    $endgroup$
    – amd
    Jan 21 at 23:21










  • $begingroup$
    @amd: How is that the case? Wouldn't it be so that only one skew along the $x$ axis will result in the correct width and only one skew along the $y$ axis will result in the correct height? Isn't the general formula defined by $frac{(x-mu_x)^2}{a^2} + frac{(y-mu_y)^2}{b^2} = 1$?
    $endgroup$
    – marcman
    Jan 21 at 23:25












  • $begingroup$
    @amd: Ahh I think I see--the issue is one of alignment. I'll edit the question to refer specifically to an axis-aligned ellipse.
    $endgroup$
    – marcman
    Jan 21 at 23:30










  • $begingroup$
    You’ve got it. Note that in general, even nailing down the axis directions might not be enough. For example, there’s an infinite number of ellipses that can be inscribed in the unit square whose axes are the square’s diagonals. There are five degrees of freedom, so center and two independent tangent points with the tangent directions would suffice.
    $endgroup$
    – amd
    Jan 21 at 23:41








  • 1




    $begingroup$
    As long as the rectangle is also axis-aligned :) Under those conditions, the problem’s equivalent to the circle one with non-square pixels.
    $endgroup$
    – amd
    Jan 22 at 0:19
















0












$begingroup$


This answer really nicely sums up the question of how to compute the number of pixels inside an inscribed circle. However, I am looking for a more generalized version of this in two ways.



1) I would like to be able to compute this to handle arbitrary centers (i.e. not the center of a pixel or right on the intersection of 4 pixels)



2) To generalize this to an axis-aligned ellipse inscribed in a $d_h times d_w$ rectangle. That is an ellipse that is symmetric across the y-axis and across the x-axis.



How do I finish the derivation for the odd-number diameter case for circles at an arbitrary center below, and how might I extend this to an inscribed ellipse?





For the matter of arbitrary centers for circles, I believe I have the start below just by slightly modifying the derivation from the linked answer (for a $d times d$ inscribing square with decimal offsets from the centers given by $(mu_x, mu_y)$):




Case I - $d = 2ell + 1$ is odd.



When $d$ is odd, the center of the inscribed circle coincides with the
center of one of the unit squares. The centers of the unit squares lie
on an integer lattice and the number we want is



$$mathcal{N}_{odd}(d) = left| left{; (x,y) in mathbb{Z}^2 :
> sqrt{ x^2 + y^2 } le frac{d}{2} ;right}right|$$




$$mathcal{N}_{odd}(d) = left| left{; (x,y) in mathbb{Z}^2, (mu_x mu_y) in mathbb{R}^2 :
sqrt{ (x - mu_x)^2 + (y-mu_y)^2 } le frac{d}{2} ;right}right|$$




Notice the
lattice points inside the inscribed circle has a $4$-fold rotational
symmetry with respect to the center of $dtimes d$ square. This give
us
$$begin{align} mathcal{N}_{odd}(d) &= 1 + 4 left|left{ (x,y)
in mathbb{Z}^2 : sqrt{ x^2 + y^2 } le frac{d}{2}, x ge 0, y > 0
;right}right|\ &= 1 + 4 sum_{y=1}^ell left|left{ x in
mathbb{Z} : sqrt{ x^2 + y^2 } le frac{d}{2}, x ge 0
;right}right| end{align} $$




$$begin{align} mathcal{N}_{odd}(d) &= 1 + 4 left|left{ (x,y)
in mathbb{Z}^2, (mu_x mu_y) in mathbb{R}^2 : sqrt{ (x-mu_x)^2 + (y-mu_y)^2 } le frac{d}{2}, x ge 0, y > 0
;right}right| \
&= 1 + 4 sum_{y=1}^ell left|left{ x in
mathbb{Z}, (mu_x mu_y) in mathbb{R}^2 : sqrt{ (x-mu_x)^2 + (y-mu_y)^2 } le frac{d}{2}, x ge 0
;right}right| end{align} $$



Although I'm not really sure how to make the leap parallel to this last reduction (I don't understand where the $1$ inside the floor function comes from):




$$ N_{odd}(d) = 1 + 4 sum_{y=1}^ell leftlfloor 1 +
sqrt{left(frac{d}{2}right)^2 - y^2} rightrfloor $$




For the even case, it seems to follow that we simply replace the $frac12$ with the decimal offsets:




Case II - $d = 2ell$ is even.



When $d$ is even, the center of the inscribed circle coincides with
the common corner of 4 unit squares. If we choose a coordinate system
such that this center is the origin, the centers of the unit squares
nows lies on an "half-integer" lattice. ...



One again, the lattice points inside the inscribed
circle has a 4-fold rotation symmetry. This leads to
$$begin{align}
mathcal{N}_{even}(d) &= 4left|left{; (x,y) in mathbb{Z}_h^2 :
sqrt{x^2+y^2} le frac{d}{2}, x > 0, y > 0;right}right|\
&=4sum_{y=1}^ell left|left{; x in mathbb{Z} :
sqrt{(x-frac12)^2+(y-frac12)^2} le frac{d}{2}, x >
0;right}right|\
&= 4sum_{y=1}^ell leftlfloorfrac12 +
sqrt{left(frac{d}{2}right)^2 -
left(y-frac12right)^2}rightrfloor end{align} $$




$$begin{align}
mathcal{N}_{even}(d) &= 4left|left{; (x,y) in mathbb{Z}_h^2, (mu_x mu_y) in mathbb{R}^2 :
sqrt{x^2+y^2} le frac{d}{2}, x > 0, y > 0;right}right|\
&=4sum_{y=1}^ell left|left{; x in mathbb{Z},(mu_x mu_y) in mathbb{R}^2 :
sqrt{(x-mu_x)^2 + (y-mu_y)^2} le frac{d}{2}, x >
0;right}right|\
&= 4sum_{y=1}^ell leftlfloormu_x +
sqrt{left(frac{d}{2}right)^2 -
left(y-mu_yright)^2}rightrfloor end{align} $$










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    There is an infinite number of different ellipses that can be inscribed in a given rectangle.
    $endgroup$
    – amd
    Jan 21 at 23:21










  • $begingroup$
    @amd: How is that the case? Wouldn't it be so that only one skew along the $x$ axis will result in the correct width and only one skew along the $y$ axis will result in the correct height? Isn't the general formula defined by $frac{(x-mu_x)^2}{a^2} + frac{(y-mu_y)^2}{b^2} = 1$?
    $endgroup$
    – marcman
    Jan 21 at 23:25












  • $begingroup$
    @amd: Ahh I think I see--the issue is one of alignment. I'll edit the question to refer specifically to an axis-aligned ellipse.
    $endgroup$
    – marcman
    Jan 21 at 23:30










  • $begingroup$
    You’ve got it. Note that in general, even nailing down the axis directions might not be enough. For example, there’s an infinite number of ellipses that can be inscribed in the unit square whose axes are the square’s diagonals. There are five degrees of freedom, so center and two independent tangent points with the tangent directions would suffice.
    $endgroup$
    – amd
    Jan 21 at 23:41








  • 1




    $begingroup$
    As long as the rectangle is also axis-aligned :) Under those conditions, the problem’s equivalent to the circle one with non-square pixels.
    $endgroup$
    – amd
    Jan 22 at 0:19














0












0








0





$begingroup$


This answer really nicely sums up the question of how to compute the number of pixels inside an inscribed circle. However, I am looking for a more generalized version of this in two ways.



1) I would like to be able to compute this to handle arbitrary centers (i.e. not the center of a pixel or right on the intersection of 4 pixels)



2) To generalize this to an axis-aligned ellipse inscribed in a $d_h times d_w$ rectangle. That is an ellipse that is symmetric across the y-axis and across the x-axis.



How do I finish the derivation for the odd-number diameter case for circles at an arbitrary center below, and how might I extend this to an inscribed ellipse?





For the matter of arbitrary centers for circles, I believe I have the start below just by slightly modifying the derivation from the linked answer (for a $d times d$ inscribing square with decimal offsets from the centers given by $(mu_x, mu_y)$):




Case I - $d = 2ell + 1$ is odd.



When $d$ is odd, the center of the inscribed circle coincides with the
center of one of the unit squares. The centers of the unit squares lie
on an integer lattice and the number we want is



$$mathcal{N}_{odd}(d) = left| left{; (x,y) in mathbb{Z}^2 :
> sqrt{ x^2 + y^2 } le frac{d}{2} ;right}right|$$




$$mathcal{N}_{odd}(d) = left| left{; (x,y) in mathbb{Z}^2, (mu_x mu_y) in mathbb{R}^2 :
sqrt{ (x - mu_x)^2 + (y-mu_y)^2 } le frac{d}{2} ;right}right|$$




Notice the
lattice points inside the inscribed circle has a $4$-fold rotational
symmetry with respect to the center of $dtimes d$ square. This give
us
$$begin{align} mathcal{N}_{odd}(d) &= 1 + 4 left|left{ (x,y)
in mathbb{Z}^2 : sqrt{ x^2 + y^2 } le frac{d}{2}, x ge 0, y > 0
;right}right|\ &= 1 + 4 sum_{y=1}^ell left|left{ x in
mathbb{Z} : sqrt{ x^2 + y^2 } le frac{d}{2}, x ge 0
;right}right| end{align} $$




$$begin{align} mathcal{N}_{odd}(d) &= 1 + 4 left|left{ (x,y)
in mathbb{Z}^2, (mu_x mu_y) in mathbb{R}^2 : sqrt{ (x-mu_x)^2 + (y-mu_y)^2 } le frac{d}{2}, x ge 0, y > 0
;right}right| \
&= 1 + 4 sum_{y=1}^ell left|left{ x in
mathbb{Z}, (mu_x mu_y) in mathbb{R}^2 : sqrt{ (x-mu_x)^2 + (y-mu_y)^2 } le frac{d}{2}, x ge 0
;right}right| end{align} $$



Although I'm not really sure how to make the leap parallel to this last reduction (I don't understand where the $1$ inside the floor function comes from):




$$ N_{odd}(d) = 1 + 4 sum_{y=1}^ell leftlfloor 1 +
sqrt{left(frac{d}{2}right)^2 - y^2} rightrfloor $$




For the even case, it seems to follow that we simply replace the $frac12$ with the decimal offsets:




Case II - $d = 2ell$ is even.



When $d$ is even, the center of the inscribed circle coincides with
the common corner of 4 unit squares. If we choose a coordinate system
such that this center is the origin, the centers of the unit squares
nows lies on an "half-integer" lattice. ...



One again, the lattice points inside the inscribed
circle has a 4-fold rotation symmetry. This leads to
$$begin{align}
mathcal{N}_{even}(d) &= 4left|left{; (x,y) in mathbb{Z}_h^2 :
sqrt{x^2+y^2} le frac{d}{2}, x > 0, y > 0;right}right|\
&=4sum_{y=1}^ell left|left{; x in mathbb{Z} :
sqrt{(x-frac12)^2+(y-frac12)^2} le frac{d}{2}, x >
0;right}right|\
&= 4sum_{y=1}^ell leftlfloorfrac12 +
sqrt{left(frac{d}{2}right)^2 -
left(y-frac12right)^2}rightrfloor end{align} $$




$$begin{align}
mathcal{N}_{even}(d) &= 4left|left{; (x,y) in mathbb{Z}_h^2, (mu_x mu_y) in mathbb{R}^2 :
sqrt{x^2+y^2} le frac{d}{2}, x > 0, y > 0;right}right|\
&=4sum_{y=1}^ell left|left{; x in mathbb{Z},(mu_x mu_y) in mathbb{R}^2 :
sqrt{(x-mu_x)^2 + (y-mu_y)^2} le frac{d}{2}, x >
0;right}right|\
&= 4sum_{y=1}^ell leftlfloormu_x +
sqrt{left(frac{d}{2}right)^2 -
left(y-mu_yright)^2}rightrfloor end{align} $$










share|cite|improve this question











$endgroup$




This answer really nicely sums up the question of how to compute the number of pixels inside an inscribed circle. However, I am looking for a more generalized version of this in two ways.



1) I would like to be able to compute this to handle arbitrary centers (i.e. not the center of a pixel or right on the intersection of 4 pixels)



2) To generalize this to an axis-aligned ellipse inscribed in a $d_h times d_w$ rectangle. That is an ellipse that is symmetric across the y-axis and across the x-axis.



How do I finish the derivation for the odd-number diameter case for circles at an arbitrary center below, and how might I extend this to an inscribed ellipse?





For the matter of arbitrary centers for circles, I believe I have the start below just by slightly modifying the derivation from the linked answer (for a $d times d$ inscribing square with decimal offsets from the centers given by $(mu_x, mu_y)$):




Case I - $d = 2ell + 1$ is odd.



When $d$ is odd, the center of the inscribed circle coincides with the
center of one of the unit squares. The centers of the unit squares lie
on an integer lattice and the number we want is



$$mathcal{N}_{odd}(d) = left| left{; (x,y) in mathbb{Z}^2 :
> sqrt{ x^2 + y^2 } le frac{d}{2} ;right}right|$$




$$mathcal{N}_{odd}(d) = left| left{; (x,y) in mathbb{Z}^2, (mu_x mu_y) in mathbb{R}^2 :
sqrt{ (x - mu_x)^2 + (y-mu_y)^2 } le frac{d}{2} ;right}right|$$




Notice the
lattice points inside the inscribed circle has a $4$-fold rotational
symmetry with respect to the center of $dtimes d$ square. This give
us
$$begin{align} mathcal{N}_{odd}(d) &= 1 + 4 left|left{ (x,y)
in mathbb{Z}^2 : sqrt{ x^2 + y^2 } le frac{d}{2}, x ge 0, y > 0
;right}right|\ &= 1 + 4 sum_{y=1}^ell left|left{ x in
mathbb{Z} : sqrt{ x^2 + y^2 } le frac{d}{2}, x ge 0
;right}right| end{align} $$




$$begin{align} mathcal{N}_{odd}(d) &= 1 + 4 left|left{ (x,y)
in mathbb{Z}^2, (mu_x mu_y) in mathbb{R}^2 : sqrt{ (x-mu_x)^2 + (y-mu_y)^2 } le frac{d}{2}, x ge 0, y > 0
;right}right| \
&= 1 + 4 sum_{y=1}^ell left|left{ x in
mathbb{Z}, (mu_x mu_y) in mathbb{R}^2 : sqrt{ (x-mu_x)^2 + (y-mu_y)^2 } le frac{d}{2}, x ge 0
;right}right| end{align} $$



Although I'm not really sure how to make the leap parallel to this last reduction (I don't understand where the $1$ inside the floor function comes from):




$$ N_{odd}(d) = 1 + 4 sum_{y=1}^ell leftlfloor 1 +
sqrt{left(frac{d}{2}right)^2 - y^2} rightrfloor $$




For the even case, it seems to follow that we simply replace the $frac12$ with the decimal offsets:




Case II - $d = 2ell$ is even.



When $d$ is even, the center of the inscribed circle coincides with
the common corner of 4 unit squares. If we choose a coordinate system
such that this center is the origin, the centers of the unit squares
nows lies on an "half-integer" lattice. ...



One again, the lattice points inside the inscribed
circle has a 4-fold rotation symmetry. This leads to
$$begin{align}
mathcal{N}_{even}(d) &= 4left|left{; (x,y) in mathbb{Z}_h^2 :
sqrt{x^2+y^2} le frac{d}{2}, x > 0, y > 0;right}right|\
&=4sum_{y=1}^ell left|left{; x in mathbb{Z} :
sqrt{(x-frac12)^2+(y-frac12)^2} le frac{d}{2}, x >
0;right}right|\
&= 4sum_{y=1}^ell leftlfloorfrac12 +
sqrt{left(frac{d}{2}right)^2 -
left(y-frac12right)^2}rightrfloor end{align} $$




$$begin{align}
mathcal{N}_{even}(d) &= 4left|left{; (x,y) in mathbb{Z}_h^2, (mu_x mu_y) in mathbb{R}^2 :
sqrt{x^2+y^2} le frac{d}{2}, x > 0, y > 0;right}right|\
&=4sum_{y=1}^ell left|left{; x in mathbb{Z},(mu_x mu_y) in mathbb{R}^2 :
sqrt{(x-mu_x)^2 + (y-mu_y)^2} le frac{d}{2}, x >
0;right}right|\
&= 4sum_{y=1}^ell leftlfloormu_x +
sqrt{left(frac{d}{2}right)^2 -
left(y-mu_yright)^2}rightrfloor end{align} $$







geometry circle area






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 21 at 23:53







marcman

















asked Jan 21 at 22:14









marcmanmarcman

152110




152110








  • 1




    $begingroup$
    There is an infinite number of different ellipses that can be inscribed in a given rectangle.
    $endgroup$
    – amd
    Jan 21 at 23:21










  • $begingroup$
    @amd: How is that the case? Wouldn't it be so that only one skew along the $x$ axis will result in the correct width and only one skew along the $y$ axis will result in the correct height? Isn't the general formula defined by $frac{(x-mu_x)^2}{a^2} + frac{(y-mu_y)^2}{b^2} = 1$?
    $endgroup$
    – marcman
    Jan 21 at 23:25












  • $begingroup$
    @amd: Ahh I think I see--the issue is one of alignment. I'll edit the question to refer specifically to an axis-aligned ellipse.
    $endgroup$
    – marcman
    Jan 21 at 23:30










  • $begingroup$
    You’ve got it. Note that in general, even nailing down the axis directions might not be enough. For example, there’s an infinite number of ellipses that can be inscribed in the unit square whose axes are the square’s diagonals. There are five degrees of freedom, so center and two independent tangent points with the tangent directions would suffice.
    $endgroup$
    – amd
    Jan 21 at 23:41








  • 1




    $begingroup$
    As long as the rectangle is also axis-aligned :) Under those conditions, the problem’s equivalent to the circle one with non-square pixels.
    $endgroup$
    – amd
    Jan 22 at 0:19














  • 1




    $begingroup$
    There is an infinite number of different ellipses that can be inscribed in a given rectangle.
    $endgroup$
    – amd
    Jan 21 at 23:21










  • $begingroup$
    @amd: How is that the case? Wouldn't it be so that only one skew along the $x$ axis will result in the correct width and only one skew along the $y$ axis will result in the correct height? Isn't the general formula defined by $frac{(x-mu_x)^2}{a^2} + frac{(y-mu_y)^2}{b^2} = 1$?
    $endgroup$
    – marcman
    Jan 21 at 23:25












  • $begingroup$
    @amd: Ahh I think I see--the issue is one of alignment. I'll edit the question to refer specifically to an axis-aligned ellipse.
    $endgroup$
    – marcman
    Jan 21 at 23:30










  • $begingroup$
    You’ve got it. Note that in general, even nailing down the axis directions might not be enough. For example, there’s an infinite number of ellipses that can be inscribed in the unit square whose axes are the square’s diagonals. There are five degrees of freedom, so center and two independent tangent points with the tangent directions would suffice.
    $endgroup$
    – amd
    Jan 21 at 23:41








  • 1




    $begingroup$
    As long as the rectangle is also axis-aligned :) Under those conditions, the problem’s equivalent to the circle one with non-square pixels.
    $endgroup$
    – amd
    Jan 22 at 0:19








1




1




$begingroup$
There is an infinite number of different ellipses that can be inscribed in a given rectangle.
$endgroup$
– amd
Jan 21 at 23:21




$begingroup$
There is an infinite number of different ellipses that can be inscribed in a given rectangle.
$endgroup$
– amd
Jan 21 at 23:21












$begingroup$
@amd: How is that the case? Wouldn't it be so that only one skew along the $x$ axis will result in the correct width and only one skew along the $y$ axis will result in the correct height? Isn't the general formula defined by $frac{(x-mu_x)^2}{a^2} + frac{(y-mu_y)^2}{b^2} = 1$?
$endgroup$
– marcman
Jan 21 at 23:25






$begingroup$
@amd: How is that the case? Wouldn't it be so that only one skew along the $x$ axis will result in the correct width and only one skew along the $y$ axis will result in the correct height? Isn't the general formula defined by $frac{(x-mu_x)^2}{a^2} + frac{(y-mu_y)^2}{b^2} = 1$?
$endgroup$
– marcman
Jan 21 at 23:25














$begingroup$
@amd: Ahh I think I see--the issue is one of alignment. I'll edit the question to refer specifically to an axis-aligned ellipse.
$endgroup$
– marcman
Jan 21 at 23:30




$begingroup$
@amd: Ahh I think I see--the issue is one of alignment. I'll edit the question to refer specifically to an axis-aligned ellipse.
$endgroup$
– marcman
Jan 21 at 23:30












$begingroup$
You’ve got it. Note that in general, even nailing down the axis directions might not be enough. For example, there’s an infinite number of ellipses that can be inscribed in the unit square whose axes are the square’s diagonals. There are five degrees of freedom, so center and two independent tangent points with the tangent directions would suffice.
$endgroup$
– amd
Jan 21 at 23:41






$begingroup$
You’ve got it. Note that in general, even nailing down the axis directions might not be enough. For example, there’s an infinite number of ellipses that can be inscribed in the unit square whose axes are the square’s diagonals. There are five degrees of freedom, so center and two independent tangent points with the tangent directions would suffice.
$endgroup$
– amd
Jan 21 at 23:41






1




1




$begingroup$
As long as the rectangle is also axis-aligned :) Under those conditions, the problem’s equivalent to the circle one with non-square pixels.
$endgroup$
– amd
Jan 22 at 0:19




$begingroup$
As long as the rectangle is also axis-aligned :) Under those conditions, the problem’s equivalent to the circle one with non-square pixels.
$endgroup$
– amd
Jan 22 at 0:19










0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3082488%2fgeneralizing-computation-of-number-of-pixels-in-inscribed-circle-to-axis-aligned%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3082488%2fgeneralizing-computation-of-number-of-pixels-in-inscribed-circle-to-axis-aligned%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

Npm cannot find a required file even through it is in the searched directory