PDA

View Full Version : how to find ellipse tangent through external point



g0tp0t
12-24-2010, 11:42 PM
I have to create a function in Java that, when given an ellipse and a point, will return the two points of tangency.

i attached a pic of what i mean

the input will be the ellipse and point D(the one in blue)

the output will be the two points circled in red

iv searched Google for days, but haven't found anything except people solving homework which didn't help. i would prefer someone showed me the math, but if there is already a function id like having it >.<

Boreas
12-25-2010, 12:30 AM
The slope from the center to a point of tangency is perpendicular to the slope from the point of tangency to D, right?

Edit: never mind, only applies for circles

g0tp0t
12-26-2010, 09:40 PM
lol, thats what my first function used. then i tested on ellipse and fail :P
it uses calculus, or so i hear from Google.

i heard a rule that said, if you take any point on an ellipse, draw a line from each foci to this point, then bisect the angel, The line bisecting the angel is perpwendicular to the tangent of te ellipse on that point.

i have been using geogebra to try and figure a relation ship between the rule i wrote a second ago and an external point. basically trying too figure it out, i haven't been able top find anything >.<. its almost like they are completely unrelated...

Boreas
12-27-2010, 02:18 AM
lol, thats what my first function used. then i tested on ellipse and fail :P
it uses calculus, or so i hear from Google.

i heard a rule that said, if you take any point on an ellipse, draw a line from each foci to this point, then bisect the angel, The line bisecting the angel is perpwendicular to the tangent of te ellipse on that point.

i have been using geogebra to try and figure a relation ship between the rule i wrote a second ago and an external point. basically trying too figure it out, i haven't been able top find anything >.<. its almost like they are completely unrelated...


So for each point on the ellipse you can get the slope of the tangent?

Loop through Points on the ellipse
using that rule, get m = slope of the tangent at Points[i]
if (D.Y - m*D.x) = (Points[i].y - m*Points[i].x) then Points[i] is one of the answers

g0tp0t
12-27-2010, 02:28 AM
i thought of that but it isnt mathematically perfect.

any_one
12-27-2010, 04:06 AM
Frankly I'd just use Boreas' method. Here are the coordinates in general:
(wolfram solver) (http://www.wolframalpha.com/input/?i=solve+%28+{y3+%3d+%28-sqrt%28a^2+y1^2-2+a^2+y1+y2%2ba^2+y2^2-4+b^2+x1+x2%2b4+b^2+x1+x3%2b4+b^2+x2+x3-4+b^2+x3^2%29%2ba+y1%2ba+y2%29%2f%282+a%29%2c+%28x 3+-+x2%29+^2+%2f+a^2+%2b+%28y3+-+y2%29+^2+%2f+b^2+%3d+1+}%2c+{x3%2c+y3}%29&incParTime=true)

y3 = y point on ellipse
x3 = x point on ellipse
x2 and y2 are the x and y shifts in the ellipse equation (x - x2)^2/a^2 etc
x1 and y1 are the coordinates of the external point.

So yeah go with Boreas' way. :p

(Method used to get that:
1. set gradients of ellipse and line equal to each other and solve for x3 or y3
2. sub into ellipse equation to find other coordinate
http://www.physicsforums.com/showthread.php?t=219998)

g0tp0t
12-30-2010, 08:38 PM
im readign that page and learning how to implement it. thanks a ton =]

Santa_Clause
01-01-2011, 02:50 PM
Erm?

Pretty sure it's just x(x1) + y(y1) = 2c or something like that...can't remember exactly, where (x1, y1) is the external point.

g0tp0t
01-03-2011, 06:18 PM
your thinking of a circle, ellipse makes it much more complicated =]

g0tp0t
01-03-2011, 06:26 PM
with that site i couldnt understand but i fanally found something i can use!!! look at this pic:

ill use geogebra to verify it works and then make a fuunction, ill post the function i make here for anyone to use =] figuring this out was too hard :P

g0tp0t
01-03-2011, 06:58 PM
it doesnt work... =[[[[[

the tangents are perfect in some pplaces but if you move the point somewhere else then the tangents are aobviously wrong =\

ill post my geogebra file.

need another method >.<

i couldnt figure out how to get tangent from the page at physics forum. it didnt make since

any_one, could u explain how u got your answer? i need to know to create the method

Zyt3x
01-03-2011, 09:54 PM
Hey man, I made you a geogebra file for you to inspect if you like..

When ANGLE1 and ANGLE2 are 90 degrees, then TANGENT1 and TANGENT2 = tangent through point EXTERNAL.
I am not sure if this will help you in any way at all, but I hope so... Play around with it, try to understand what I did to get this and you might be able to make a function out of it... Idk..

Thanks for helping me understand geogebra better :) It was quite fun

File: http://zytex.x10hosting.com/upload/uploaded/all/tangent.ggb

I'm looking forward to learning about this @ school lol

g0tp0t
01-04-2011, 05:06 PM
use angle bisector. this shows a law i found on Google, i forget the name, if it has one.

this wont get me the exact point of tangency through external point but looping would work as a substitute.

it will lower performance greatly though i think. the form needs to be constantly repainted and recalculate points each time.

Santa_Clause
01-10-2011, 05:18 AM
*Sigh*

The chord of contact (ie. the line joining the two points of tangency) has equation:

x(x0)/a^2 + y(y0)/b^2 = 1, where (x0, y0) is the external point.

Solve that equation simultaneously with the equation of the ellipse, and you'll get your two points of tangency.