0

Imagine we have a point P inside a circle. If we are not looking at the circle head-on, from our perspective the circle is actually an ellipse. The point P is then also skewed. If we know the lengths of the major and minor axes of the ellipse, the coordinates of point P relative to the center of the ellipse, and the radius of the original circle, can we calculate the coordinates of P relative to the center of the original circle?

My original idea was to simply scale the x coordinate of the point inside the ellipse by the ratio of the radius of the circle to the horizontal axis of the ellipse, and similarly, scale the y coordinate of the point by the ratio of the radius of the circle and the vertical axis of the ellipse. However, I proved to myself that this is incorrect, as points on the boundary of the ellipse would not be mapped to the boundary of the circle. How else might we go about getting these coordinates?

EDIT: Oops, I think I just had an error in my arithmetic. Right now, here's what I think the solution is... Let (x1, y1) be a point inside a circle. Skewing our perspective to make the circle an ellipse, we now analyze the point (xe, ye) relative to the center of the ellipse. Let a and b be the horizontal and vertical axes of the ellipse, respectively and r be the radius of the circle. Then x1 = (xe / (a / 2)) * r and y1 = (ye / (b / 2)) * r. Is this correct?

Justin
  • 133
  • well, you can simply parametrize the ellipse and the circle and put the inverse of one parametrization into the other which would give you your map – SK19 May 10 '20 at 23:03
  • https://www.mathopenref.com/coordparamellipse.html – SK19 May 10 '20 at 23:06
  • I've actually just added an edit to the original question. I think I just made an arithmetical error in my original calculations. I like the way shown in that article, but I'm still wondering if my method is correct as well. – Justin May 10 '20 at 23:12
  • Your idea is good, but requires an important underlying assumption: that you’re looking at the circle from far away so that you’ve got effectively a parallel projection of it. For a true perspective transformation the image of the circle isn’t obtained by a simple affine scaling like this. – amd May 11 '20 at 23:58

1 Answers1

1

Let’s get a simple arithmetic issue out of the way first. The parameters $a$ and $b$ of an ellipse in standard position conventionally denote semiaxis lengths, so your first attempt wasn’t that far off: semiaxis lengths correspond to the radius of the circle, while the full principal axis lengths correspond to its diameter. Since you’re essentially comparing diameters to radii in your formula, you needed a factor of $2$ in there somewhere.

There’s a more subtle problem with your approach, though, which is that you’re neglecting the effects of perspective. To put it in more formal mathematical terms, you’re using a parallel projection instead of a central projection. While it’s true that foreshortening causes the circle to look like an ellipse, that foreshortening isn’t uniform: regions farther from the viewpoint get “squished” more than regions that are nearer. The upshot of this is that even though you can obtain the outline of the region by a simple scaling of the circle, those same scale factors don’t apply to points in its interior (or to its exterior, for that matter). One effect that should make this obvious is that the apparent center of the elliptical image doesn’t coincide with the image of the circle, as illustrated below.

Offset ellipse image

Here we’re looking straight at the center of circle that’s tilted away from us at the top of the image. Note how the ellipse isn’t centered on the origin, which is the image of the circle’s center. This variable foreshortening becomes even more apparent if we plot the images of several concentric circles:

Concentric circle images

Notice how, as the circles gets smaller, their images are closer and closer to being centered on the origin. This makes geometric sense: as the circle gets smaller relative to its distance from the viewpoint, the relative difference in distances between the nearer and farther points on the circle becomes smaller and so the foreshortening becomes more uniform. Also, the rays along which we’re projecting become closer and closer to parallel the smaller the object, so, if the circle is small relative to the distance from which we’re viewing it, your method of simple scaling will give a pretty good approximation. In fact, this approximation is often used in image processing to simplify calculations.

Now, it is possible to construct an exact mapping between the circle and ellipse that takes perspective into account, but doing so requires more information that just the axis lengths (and orientations) of the ellipse. Broadly speaking, you’ll need four known point pairs (or equivalent constraints) in “general position,” i.e., no three of the point lie on a straight line.

amd
  • 55,082
  • Ah, I see, thank you very much for this insight. This is really what I was looking for. For my purpose, I think I will need the precision of the central projection as opposed to my original parallel projection. This is a great start for me to learn more about this. Would you happen to know of any more resources I can check out so that I can learn more about how to accurately construct a central projection like this? – Justin May 15 '20 at 23:02