Calculating angle of circle to produce given ellipse

  • Context: Graduate 
  • Thread starter Thread starter HKragh
  • Start date Start date
  • Tags Tags
    Angle Circle Ellipse
Click For Summary

Discussion Overview

The discussion revolves around the geometric relationship between a circle and the ellipse it projects onto a screen when viewed from a camera at an angle. Participants explore methods to calculate the angle at which a circle must be tilted to produce a specific ellipse, considering factors such as eccentricity, position on screen, and perspective transformations. The conversation includes both theoretical and practical aspects, particularly in the context of game engines.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes the need to calculate the tilt angle of a circle to match a given ellipse based on its eccentricity and position on screen, noting that previous methods have been imprecise.
  • Another participant questions the clarity of the problem's geometry and inquires about the relevance of camera calibration.
  • A participant clarifies that the context is within a game engine, where the camera's perspective transformation matrix is defined, and outlines the parameters of the ellipse and its axes.
  • A suggestion is made that a circle tilted at an angle \(\theta\) projects to an ellipse with specific relationships between the semi-major and semi-minor axes based on trigonometric principles.
  • One participant challenges the proposed solution, arguing that the semi-major axis does not represent the diameter of the circle and suggests an alternative approach to find points on the ellipse that represent the diameter of the circle.
  • A link to an external resource is provided, which offers a potential solution to the problem.
  • Another participant raises a related question about proving the relationship between the radius of a circle and the semi-major axis of the resulting ellipse without relying on orthographic projection assumptions.

Areas of Agreement / Disagreement

Participants express differing views on the clarity of the problem and the validity of proposed solutions. There is no consensus on a definitive method to calculate the tilt angle, and multiple competing approaches are discussed.

Contextual Notes

Some participants note limitations in their understanding of the geometry involved, and there are unresolved aspects regarding the distance to the camera and its effect on calculations. The discussion highlights the complexity of projecting a circle to an ellipse under various conditions.

HKragh
Messages
12
Reaction score
0
I know I should keeps this short, but I need to explain it a little. So, please have patience with me :)

Given a standard ellipse, and its eccentricity and position on screen, is there some clever way of calculating how much a regular circle needs to be tilted in (angles) in a perspective view to produce said ellipse? Obviously the tilt is related to the position on screen, as the very act of moving a circle around, will change the ellipse. So it's not so much a tilt in world space I need to calculate, as it is the angle between a ray going from the center of the circle to the camera, and the normal of the circle (I'm not sure if the normal of a circle is the right term when speaking of a 2D object, but think of the cap of a cylinder instead, then you know what I mean by the normal from the center of the cap).

I have tried for a long time now, by using a purely trigonomical approach, but even though my results aren't way off, they aren't precise either. And the closer to camera the circle is, the less precise my method is. It's surele because my approach considers the view orthogonal ;)

I have the angular separation of the two maximum distances (on the semi-major axis, or more plainly, the total width of the ellipse), calculated from the cameras field of view, and the screen separation of said points, and the center position of the ellipse on screen, which my intuition tells me I need, in order to calculate this. I also have the perspective transformation matrix of the camera. I just can't find the right approach. The ellipse are in no way alligned with the view axis, it can be rotated.

This thread, which I posted some weeks ago, gave me a great solution to a related problem, but this was before I had the ellipse. And even though the math I was offered back then in theory would be what I need to solve this with the ellipse, it is WAY too affected by even the smallest inaccuracies of the center direction. It only works on perfect data. This is why I came up with this elliptic approach instead, where the ratio between the semi major/-minor axis should be A LOT less affected by inaccuracies, and the calculated angle should be more precise, even when data is noisy.

Sorry for the long story. Please, if anybody can push me onwards, I would be grateful! And if not, I'm sure it's for a good reason ;)
 
Physics news on Phys.org
Hi,

I find it hard to answer your question as I found the geometry of your problem is not explained clearly. You spoke about "perspective transformation matrix of the camera". Is your problem related in any way to camera calibration with dot array calibration pattern?
 
mnb96 said:
Hi,

I find it hard to answer your question as I found the geometry of your problem is not explained clearly. You spoke about "perspective transformation matrix of the camera". Is your problem related in any way to camera calibration with dot array calibration pattern?

It all goes on in a game engine, so the camera has perspective transformation matrix defined. And no, this is not for calibrating, this is just as explained ;)

1) I have an ellipse.
2) This ellipse has a major and minor semi axis. The max points of these two axis are defined. The axis rotation on screen is also defined.
3) The world angle from the camera through each of these points are defined

I need to find a method of calculating the angular tilt of a circle, which would produce such an ellipse on that exact location on screen.

But..Hold on with trying to answer me, I may have found a solution myself. Or at least a work around.
 
Drawing a picture should help you. If the plane of the circle makes angle \theta with the screen on which you are projecting, you have a line of length 2r (representing the circle of radius r) forming the hypotenuse of a right triangle with angle \theta and base leg, the projection, of length 2r cos(\theta). That is, a circle with radius r, x^2+ y^2= r^2, at angle \theta projects to an ellipse with major semi-axis of length r and minor semiaxis of length r cos(\theta). Its equation would be x^2/r^2+ y^2/(r^2 cos^2(\theta))= 1.
 
Thanks for the answer! I just did some pictures to visualize a problem with your solution. Unless I misunderstand.

The semi-major axis, or the vectors pointing towards them, doesn't represent the diameter of the circle. If I calculate at what distance I have a circle radius between one of the max points on the semi major axis, and the center of the ellipse, I will calculate a distance too short, because the angle is a little too wide. As the circle rotates aways from you, the semi major axis, if projected onto the circle in world space, will lie between the two tangent points of the circle (or ellipse) as seen from above, which intersects the camera. And as I don't know the distance to the camera, I can't calculate those two points. And I can't calculate the distance without them either. Or maybe I can. I'm simply not skilled enough ;)

TopDownEllipse.jpg


SideViewEllipse.jpg


My next approach is to drop the semi major axis max points all together, and instead find the actual points on the ellipse, which represents the diameter of the circle. This should be fairly easy. I know the circle center on screen. I know the center of the ellipse. The distance between those two could be used as my y-value, and then the x-value should be calculated. That would give me two points on the ellipse, which, if I shoot vectors at them, and measure the angle, could give me the distance to the circle center. When that is done, I'll look into your solution! It looks valid from then on.

EDIT: The pics doesn't show up as pictures, even though they're wrapped in IMG tags. Last time I used those tags, it worked fine. I have no clue as to why this doesn't work. Sorry. Here they are as attachments as well.
 

Attachments

  • TopDownEllipse.jpg
    TopDownEllipse.jpg
    33.3 KB · Views: 1,773
  • SideViewEllipse.jpg
    SideViewEllipse.jpg
    22.6 KB · Views: 1,510
Last edited:
Hi,

I have a problem which is quite similar: if you take a picture of a circle with a known radius, depending on the angle of view, the circle will become an ellipse on the picture. The semi-major axis of this ellipse will have the same length as the radius of the original circle. How do you prove it without making the orthographic projection assumption only valid at infinite distance between the camera and the circle (as made in the link above)?

Cheers.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 8 ·
Replies
8
Views
4K