Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Intersection of a line and a parabola in 3D

Subject: Intersection of a line and a parabola in 3D

From: kamuran turksoy

Date: 1 Oct, 2012 19:59:08

Message: 1 of 5

How can i find the intersection of a line and a parabola in 3D?
For example a line between two points p1 (x1,y1,z1) and p2(x2,y2,z2)
and parabola P: z=2*x^2+2*y^2-1

I want to find their intersection. Or for given points find whether the line is intersect with parabola (in 3D) or not?

Subject: Intersection of a line and a parabola in 3D

From: Matt J

Date: 1 Oct, 2012 20:10:08

Message: 2 of 5

"kamuran turksoy" <kamuranturksoy@gmail.com> wrote in message <k4csmc$hr0$1@newscl01ah.mathworks.com>...
> How can i find the intersection of a line and a parabola in 3D?
> For example a line between two points p1 (x1,y1,z1) and p2(x2,y2,z2)
> and parabola P: z=2*x^2+2*y^2-1
>
> I want to find their intersection. Or for given points find whether the line is intersect with parabola (in 3D) or not?

the parametric equations for the line are

x(t)= x1+t*(x2-x1);
y(t)= y1+t*(y2-y1);
z(t)= z1+t*(z2-z1);

Substituting [x(t),y(t),z(t)] into the equation for the parabola will give you a quadratic 1D equation in t. If it has a real solution(s), then an intersection occurs.

Subject: Intersection of a line and a parabola in 3D

From: Matt J

Date: 1 Oct, 2012 20:16:07

Message: 3 of 5

"Matt J" wrote in message <k4ctb0$k8l$1@newscl01ah.mathworks.com>...
>
> the parametric equations for the line are
>
> x(t)= x1+t*(x2-x1);
> y(t)= y1+t*(y2-y1);
> z(t)= z1+t*(z2-z1);
>
> Substituting [x(t),y(t),z(t)] into the equation for the parabola will give you a quadratic 1D equation in t. If it has a real solution(s), then an intersection occurs.
==============

The solutions also have to satisfy 0<=t<=1, if this is a finite line segment between p1 and p2.

Subject: Intersection of a line and a parabola in 3D

From: kamuran turksoy

Date: 1 Oct, 2012 20:30:08

Message: 4 of 5

"Matt J" wrote in message <k4ctm7$lqa$1@newscl01ah.mathworks.com>...

> The solutions also have to satisfy 0<=t<=1, if this is a finite line segment between p1 and p2.

Do i have to substitute x(t),y(t) and z(t) for all t? If yes, what if the interval of t is too large?

Subject: Intersection of a line and a parabola in 3D

From: Matt J

Date: 1 Oct, 2012 20:49:08

Message: 5 of 5

"kamuran turksoy" <kamuranturksoy@gmail.com> wrote in message <k4cugg$ork$1@newscl01ah.mathworks.com>...
> "Matt J" wrote in message <k4ctm7$lqa$1@newscl01ah.mathworks.com>...
>
> > The solutions also have to satisfy 0<=t<=1, if this is a finite line segment between p1 and p2.
>
> Do i have to substitute x(t),y(t) and z(t) for all t? If yes, what if the interval of t is too large?
================

You can solve this analytically. Substituting x(t),y(t) and z(t) will lead to a quadratic polynomial whose roots you have to find. Just use the ROOTS command.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us