Does a sphere projected into 2D space always result in an ellipse?

18

4

My intuition has always been that when any sphere is projected into 2D space that the result will always mathematically be an ellipse (or a circle in degenerate cases).

In the past when I was actively doing my own graphics programming and brought this up with other people they were adamant that I was wrong. If I recall correctly they believed the result could be something vaguely "egg shaped".

Who was correct?


Since there is already one answer submitted, I don't wish to totally change my question but I realize I left out important details due to losing familiarity with the field over the years.

I intended to ask specifically about perspective projection where the projection is a linear application.

The other projections are of course interesting for many uses so I wouldn't want them removed at this point. But it would be great if answers could have perspective projection as their most prominent section.

hippietrail

Posted 2015-09-15T11:55:18.913

Reputation: 253

1

This should go somewhere in this thread, so adding it here :) Inigo Quilez's analytic sphere projection: https://www.shadertoy.com/view/XdBGzd

– Mikkel Gjoel – 2016-02-02T12:11:49.200

2

Assuming a perspective projection, AFAICS the 'boundary' formed by the view-points horizon will be a (truncated) cone and thus most of the projection will be a conic section: https://en.wikipedia.org/wiki/Conic_section. An ellipse is thus a possibility, but not the only one.

– Simon F – 2015-09-15T12:27:54.890

Pardon my naivety, isn't an ellipse a conic section? Could a projected sphere ever result in a parabola or hyperbola? – hippietrail – 2015-09-15T12:31:23.007

If you look at the wikipedia diagram, https://en.wikipedia.org/wiki/Conic_section#/media/File:Conic_Sections.svg, and consider the plane onto which you are projecting, you can get anything from an ellipse/circle, through to unbounded parabolas or hyperbolas (and I guess if the plane passes through the eye, even degenerate cases)

– Simon F – 2015-09-15T12:35:38.403

Apologies! I omitted a key element of my question, that I was only concerned with perspective projection. I'm very rusty in this field and its terminology after many years away from it, yet I remain interested. By the way a [tag:perspective] would be a worthwhile addition to the site for questions such as this. – hippietrail – 2015-09-15T14:55:59.870

1In that case I will promote my comments to an answer... – Simon F – 2015-09-15T15:06:46.273

1you need to add a constraint. fisheye is also a perspective projection, and you won't get ellipses. the constraint you need is linearity. – v.oddou – 2015-09-16T01:16:17.283

@v.oddou: Thanks for your help with the terminology. Would that result in something like "projected into linear perspective" or something else? – hippietrail – 2015-09-16T05:18:15.043

1I would rather say something like "where the projection is a linear application". There might be some shortcut term for this, like "linear epimorphism" or something, but I long forgot that. – v.oddou – 2015-09-16T06:14:06.193

@v.oddou: I've tweaked the wording of the question based on your advice. – hippietrail – 2015-09-16T06:21:29.973

Answers

14

Assuming a perspective projection and a view point external to the sphere, then the 'boundary' formed by the view point and the circle on the sphere which forms the horizon WRT the view point, will be a cone.

Doing a perspective projection (onto a plane) is then equivalent to intersecting this cone with the plane which thus produces a conic section. FYI the four, non-degenerate, cases are shown in this image from Wikipedia enter image description here

An ellipse/circle is thus a possibility, but not the only one - unbounded parabolas or hyperbolas (and I guess if the plane passes through the eye, even degenerate cases ) are possible.

Simon F

Posted 2015-09-15T11:55:18.913

Reputation: 2 420

I'm unable to imagine how the result could be a parabola or hyperbola despite the absolute logic of your argument. Some words clarifying what kind of layout would lead to these would be great. The best I can get my brain around is "something to do with infinities somehow" ... – hippietrail – 2015-09-15T15:27:42.237

3Maybe something equivalent might help. Imagine you are holding a torch (flashlight for those in North America), which makes a conic beam, and you are in in a dark empty (infinite) warehouse. Shining the torch at the floor you see an ellipse. Now gradually tilt the axis of the torch back towards the horizontal. The ellipse will get longer and longer until the point when the topmost 'edge' of the beam itself is horizontal, i.e. parallel to the floor. Now the projection is a parabola and it stretches on forever. Tilting it further will form a hyperbola. – Simon F – 2015-09-15T15:42:19.340

1@hippietrail: It's perhaps worth noting that, with a view plane in front of the camera, the only way you can end up with a parabola or a hyperbola is if at least part of the sphere is between the focal point and the view plane. – Ilmari Karonen – 2015-09-15T22:43:58.657

@IlmariKaronen: What would "focal point" mean in this context? The point the eye is focussing on? The vanishing point? (I taught myself 3D perspective rotation and projection as a 12 or 13 year old and never gained fluency in the math and terminology.) – hippietrail – 2015-09-19T04:47:42.520

@hippietrail Focal point, in this context, would be the apex of the cone. Effectively the "pinhole" of the perspective, pinhole camera model. (PS Does the name imply meeting "a strange lady. She made me nervous.."?) – Simon F – 2015-09-21T07:49:41.237

10

Projection systems are used to convert a 3D shape to a planar (2D) shape.

According to the type of projection system, different results and shapes like rectangles, pies, ellipses, circles, ... can be produced out of a sphere.

Projection systems can be classified by the characteristics of the result they generate.

To continue, I would like to use a very touchable and common example that we have all seen before, Earth sphere and global wide maps, they are everywhere.

Suppose your sphere is the earth!

Imagine the earth as your sphere and a planar world map that is created from the spherical shape of the earth. In most of the world maps you see the countries near to the poles are getting much bigger than they are in reality, like Iceland which is 1/14 of Africa continent in reality but the map shows them both as equal. This is because when we are omitting one dimension we loose one characteristic of our shapes.

Different projection systems and their results

This is a planar projection which doesn't conserve distance, angles or area. The red circles show the amount of exaggeration that is the product of this projection.

First

Equal-Area, look at Iceland and Africa in this one and compare with above.

Second

Projection systems can be classified by what they preserve.

  1. Equal area.
  2. Equal angle which preserve the shape without distortion (conformal).
  3. Equal distance.
  4. ......

Conformal projections preserve the shapes but area will not be preserved (the first above picture) this one is the most famous projection system that is used in many applications. Your sphere is a rectangle here!


So you cannot say a sphere will be projected to an ellipse always. As mentioned above a sphere can be projected to a rectangle (first shape) or can be an ellipse but with different characteristics (equal angle, distance, shape, area - see the following picture), or you may also project a sphere into a conic and then open the conic so you will have a pie.

Each of the above projection systems can be applied with iterative or direct algorithms that can be found on the internet. I didn't talk about the formula and transformations because you didn't ask. Although I wish you to find this answer useful.

Third


In perspective projections I say yes only ellipses will be produced out of spheres

Cutting a conic with a horizontal plane creates a circle.

Cutting with an oblique plane creates a bevel which would be an ellipse or a hyperbola depending on the cutting angle, and when this angle inclines to be vertical in will create a parabola (following picture).

Ellipse

Maybe this is obvious but take a look at their equations.

For simplicity I assumed all geometries are origin centered.

Equations:

Circle: $x^2+y^2=r^2$

Ellipse: $x^2/a^2+y^2/b^2=1$

Hyperbola: $x^2/a^2-y^2/b^2=1$

Parabola: $y^2=4ax$

Morphology :

An ellipse has two foci obviously. A circle as a special kind of ellipsis has two foci too but they are coincident. A hyperbola however is a y axis mirror of its equal ellipsis and it has two foci too. A parabola has one focus but actually it has two because the second one is at infinity: when the cutting plane inclines to 90 degrees (bearing angle), second focus goes to infinity.

Conclusion

As you see all are ellipses, however you may name them differently to describe special cases, but if you are going to implement it in a game, you need to assume an ellipse equation and it is enough. I can't tell which one of you guys are right, you or your friend, because both could be right.

Zich

Posted 2015-09-15T11:55:18.913

Reputation: 200

2Thanks for your answer. Please see my addenda about perspective projection. Apologies for this oversight in my original wording. – hippietrail – 2015-09-15T15:28:33.860

Circles are special kind of ellipsis, – Zich – 2015-09-15T16:41:54.680

2Yes I tried to cover that in my original question. Points and line segments are other degenerate ellipses too I believe. – hippietrail – 2015-09-15T17:27:34.050

3@hippietrail: The Earth is actually an excellent example also for perspective projections. If you take an ordinary photograph outdoors, pointing the camera towards the horizon, then (assuming that your lens has no distortion, and that the Earth is approximately a perfect sphere) the image of the Earth in the picture will be (a section of) a very broad hyperbola. – Ilmari Karonen – 2015-09-15T22:53:04.833

1@IlmariKaronen: Wow that makes it super clear and is worthy of an answer of its own! Would there be a version of this that would result in a parabola? – hippietrail – 2015-09-16T05:20:12.070

1@hippietrail I add some explanation at the end of my answer, hope it could answer new aspects of edited question. and thanks for your complement. – Zich – 2015-09-16T10:41:15.820

I've made some edits which hopefully don't change the intended meaning of your answer - feel free to roll back the changes if you wish. – trichoplax – 2015-09-18T09:33:41.090

I changed quote blocks to headings since they weren't quoting anything. Hopefully this is clearer now - I've opened a meta discussion about whether to edit to convert to headings like this.

– trichoplax – 2015-09-18T11:16:52.733

10

This is more like a long comment to @SimonF's answer that I'm trying to make somewhat self contained.

All cuts of cone are possible, hyperbola, parabola and ovals. This is easy to test by drawing images in a 3D engine by a extremely wide angle camera. Rotate the camera to say in 30 degree angle so the object is not in the middle of your focus. Then gradually move the camera closer to the sphere.

enter image description here

Image 1: Flying very close to a sphere looking slightly sideways. Notice how we suddenly puncture the surface form inside.

So to recap when the sphere is very close so it exits the picture in wide image it can be a parabola or hyperbola. But the shape will just exit the frame to do so.

joojaa

Posted 2015-09-15T11:55:18.913

Reputation: 6 680

1What might be really nice is if your animation could change the shading for the various outcomes: Say white for ellipse, green (for the 'one frame' of parabola), and red for hyperbola. :-) – Simon F – 2015-09-16T08:42:32.223

2@SimonF i thought about this, i was planning something like nathan reed. But i was in a bit of hurry, i was lucky to get this render done. Initially i was a bit sceptical whether hyperbola could exist at all, but yes now it seems obvious. – joojaa – 2015-09-16T09:08:58.803

10

SimonF's reasoning basically convinced me, but I decided to do a sanity check. I loaded up a UE4 level that happens to have some spheres, like this one:

enter image description here

I set the camera FOV up to 160 degrees to give lots of perspective distortion, and positioned it so the sphere was near the corner of the image:

enter image description here

Then I took this into Inkscape and used the ellipse tool to draw on it:

enter image description here

Surprise! It's a perfect fit!

Nathan Reed

Posted 2015-09-15T11:55:18.913

Reputation: 15 036

1Very prettily illustrative! What do you think about tackling the parabola and hyperbola cases? – hippietrail – 2015-09-15T20:47:34.230

2@hippietrail Unfortunately, vector art programs don't have parabola and hyperbola tools the way they have ellipse tools, so it would be a bit harder... :) – Nathan Reed – 2015-09-15T22:00:33.020

@NathanReed sure but they do have general graphing tools, (if not you can get one from me) graph a generic parabola and scale/rotate to fit. – joojaa – 2015-09-16T09:11:46.980