Calculate point in ellipse given a unit vector

Click For Summary

Discussion Overview

The discussion revolves around calculating a point on an ellipse given a unit vector, the center of the ellipse, and its radii. Participants explore the mathematical formulation and programming implementation related to collision detection between two ellipses.

Discussion Character

  • Technical explanation, Mathematical reasoning, Debate/contested

Main Points Raised

  • One participant describes their approach to finding a point on the ellipse using a unit vector, ellipse center, and radii, but notes an issue with incorrect collision detection.
  • Another participant questions the terminology of "ellipse radius" and seeks clarification on its meaning in the context of the ellipse equation.
  • A subsequent reply clarifies that the "ellipse radius" refers to the semi-major and semi-minor axes, denoted as a and b in the ellipse equation.
  • Another participant suggests an alternative method by solving for y in terms of x using the slope derived from the unit vector and the ellipse equation, proposing a specific calculation for x.

Areas of Agreement / Disagreement

Participants do not reach consensus on the terminology used (ellipse radius) and the method for calculating the point on the ellipse. Multiple approaches and interpretations are presented without resolution.

Contextual Notes

There is a lack of clarity regarding the definitions and implications of the terms used, particularly "ellipse radius." The discussion also involves assumptions about the translation of the ellipse to the origin, which may affect the calculations.

mariano_donat
Messages
8
Reaction score
0
Hi to everyone.

I'm detecting collision between two ellipses. I've got my unit vector, my ellipse center and radius (horizontal and vertical). I want to calculate the point that lies in the ellipse on the direction of the unit vector. See the image attached. Suppose the red arrow is my unit vector and I want to get the coordinates of the green colored point. I'm just multiplying my unit vector times my radius plus the center of the ellipse. The formula looks like this:

Code:
//Assume unit vector has been already calculated at this stage, ellipseCenter and ellipseRadius has been given
Vector pointInEllipse = VectorMake(unitVector.x * ellipseRadius.x + ellipseCenter.x, unitVector.y * ellipseRadius.y + ellipseCenter.y);

The point I get using the above formula lies on the ellipse, but it's translated on both axis a little bit, translated enough to detect collisions when haven't occurred any.
What am I missing here?

Thank you very much in advance.
 

Attachments

  • pointinellipse.png
    pointinellipse.png
    1.2 KB · Views: 611
Mathematics news on Phys.org
I've never heard of an ellipse radius. If the equation of the ellipse is

\frac{x^2}{a^2}+\frac{y^2}{b^2}=1

what quantity represents the "ellipse radius"?
 
I apologize for that, it's a and b from that equation, ellipseRadius.x = a and ellipseRadius.y = b.
 
I have trouble deciphering your syntax in that programming language. But if you have a unit vector you have the slope m. Assuming the picture is translated to the origin, why not just solve y = mx with the equation of the ellipse? A quick calculation seems to show you just need to calculate something like

x=\pm\frac{ab}{\sqrt{m^2+b^2}}
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 20 ·
Replies
20
Views
10K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K