Got Questions? Get Answers.
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:
How to define if a point is inside a spherical cap?

Subject: How to define if a point is inside a spherical cap?

From: Liana

Date: 6 Apr, 2011 03:06:05

Message: 1 of 6

Hi,

I'm trying to define if a point (x,y,z) is inside a spherical cap. To solve the problem, I'm using two equations:
1) equation of a sphere: x1^2 + y1^2 + z1^2 = R^2
2) equation of the plane that cuts a sphere to produce a spherical cap: ax2+by2+cz2+d=0

Could someone please give me a general idea of how to solve this problem?

Thanks a lot!

Subject: How to define if a point is inside a spherical cap?

From: Nasser M. Abbasi

Date: 6 Apr, 2011 03:11:12

Message: 2 of 6

On 4/5/2011 8:06 PM, Liana wrote:
> Hi,
>
> I'm trying to define if a point (x,y,z) is inside a spherical cap. To solve the problem,
> I'm using two equations:
> 1) equation of a sphere: x1^2 + y1^2 + z1^2 = R^2
> 2) equation of the plane that cuts a sphere to produce a spherical cap: ax2+by2+cz2+d=0
>
> Could someone please give me a general idea of how to solve this problem?
>

should'nt an "equation" be written in terms of the independent variables
x,y,z ?

Then why are you using x1,y1,z1 somewhere and x2, y2 and z2 somewhere else?


--Nasser

Subject: How to define if a point is inside a spherical cap?

From: John D'Errico

Date: 6 Apr, 2011 03:18:05

Message: 3 of 6

"Liana" wrote in message <inglas$b5u$1@fred.mathworks.com>...
> Hi,
>
> I'm trying to define if a point (x,y,z) is inside a spherical cap. To solve the problem, I'm using two equations:
> 1) equation of a sphere: x1^2 + y1^2 + z1^2 = R^2
> 2) equation of the plane that cuts a sphere to produce a spherical cap: ax2+by2+cz2+d=0
>
> Could someone please give me a general idea of how to solve this problem?
>
> Thanks a lot!

A point would be inside a spherical cap if...

1. It is inside the sphere. Since this inside of the sphere
is defined by the equation:
    x1^2 + y1^2 + z1^2 <= R^2
this part seems trivial.

2. The point falls on the indicated side of the plane in
question. This takes not much more than a dot product
and a test for the sign of the result. (Hint: define the
plane in terms of a point on the plane, and the normal
vector to the plane. Which direction does that normal
vector point?)

WTP?

John

Subject: How to define if a point is inside a spherical cap?

From: Liana

Date: 6 Apr, 2011 03:22:04

Message: 4 of 6

yes, there must be just x,y,z, for sure.

I have some idea, but I'm not sure that it's the best solution:
1) check if the point is inside a sphere
2) if it's inside, then check on which side of the plane is that point (my plane is parallel to yz axis)

"Nasser M. Abbasi" <nma@12000.org> wrote in message <inglki$j1f$1@speranza.aioe.org>...
> On 4/5/2011 8:06 PM, Liana wrote:
> > Hi,
> >
> > I'm trying to define if a point (x,y,z) is inside a spherical cap. To solve the problem,
> > I'm using two equations:
> > 1) equation of a sphere: x1^2 + y1^2 + z1^2 = R^2
> > 2) equation of the plane that cuts a sphere to produce a spherical cap: ax2+by2+cz2+d=0
> >
> > Could someone please give me a general idea of how to solve this problem?
> >
>
> should'nt an "equation" be written in terms of the independent variables
> x,y,z ?
>
> Then why are you using x1,y1,z1 somewhere and x2, y2 and z2 somewhere else?
>
>
> --Nasser
>

Subject: How to define if a point is inside a spherical cap?

From: Liana

Date: 6 Apr, 2011 03:23:04

Message: 5 of 6

Thanks, John D'Errico. It seems that I came to the same conclusion:)

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <ingm1d$lp5$1@fred.mathworks.com>...
> "Liana" wrote in message <inglas$b5u$1@fred.mathworks.com>...
> > Hi,
> >
> > I'm trying to define if a point (x,y,z) is inside a spherical cap. To solve the problem, I'm using two equations:
> > 1) equation of a sphere: x1^2 + y1^2 + z1^2 = R^2
> > 2) equation of the plane that cuts a sphere to produce a spherical cap: ax2+by2+cz2+d=0
> >
> > Could someone please give me a general idea of how to solve this problem?
> >
> > Thanks a lot!
>
> A point would be inside a spherical cap if...
>
> 1. It is inside the sphere. Since this inside of the sphere
> is defined by the equation:
> x1^2 + y1^2 + z1^2 <= R^2
> this part seems trivial.
>
> 2. The point falls on the indicated side of the plane in
> question. This takes not much more than a dot product
> and a test for the sign of the result. (Hint: define the
> plane in terms of a point on the plane, and the normal
> vector to the plane. Which direction does that normal
> vector point?)
>
> WTP?
>
> John

Subject: How to define if a point is inside a spherical cap?

From: Vinita

Date: 25 Jul, 2012 11:10:08

Message: 6 of 6

Hi John,
I need to draw a plane through (0,0,0) i.e. origin. Is it possible to draw a plane with this much information only.
"John D'Errico" <woodchips@rochester.rr.com> wrote in message <ingm1d$lp5$1@fred.mathworks.com>...
> "Liana" wrote in message <inglas$b5u$1@fred.mathworks.com>...
> > Hi,
> >
> > I'm trying to define if a point (x,y,z) is inside a spherical cap. To solve the problem, I'm using two equations:
> > 1) equation of a sphere: x1^2 + y1^2 + z1^2 = R^2
> > 2) equation of the plane that cuts a sphere to produce a spherical cap: ax2+by2+cz2+d=0
> >
> > Could someone please give me a general idea of how to solve this problem?
> >
> > Thanks a lot!
>
> A point would be inside a spherical cap if...
>
> 1. It is inside the sphere. Since this inside of the sphere
> is defined by the equation:
> x1^2 + y1^2 + z1^2 <= R^2
> this part seems trivial.
>
> 2. The point falls on the indicated side of the plane in
> question. This takes not much more than a dot product
> and a test for the sign of the result. (Hint: define the
> plane in terms of a point on the plane, and the normal
> vector to the plane. Which direction does that normal
> vector point?)
>
> WTP?
>
> John

Tags for this Thread

No tags are associated with 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