Determining if a given point is inside a right circular cylinder

  • Context: Undergrad 
  • Thread starter Thread starter willworkforfood
  • Start date Start date
  • Tags Tags
    Circular Cylinder Point
Click For Summary

Discussion Overview

The discussion revolves around determining whether a given point (x, y, z) lies inside a right circular cylinder. Participants explore various methods for checking the position of the point relative to the cylinder's dimensions and orientation, including mathematical formulations and geometric reasoning.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests that if the cylinder is aligned with the axes, the problem simplifies to checking the distance from the center of the cylinder in the x-y plane and comparing the z-coordinate with the cylinder's height limits.
  • Another participant reiterates the same approach but notes that the cylinder is not defined on the axes, implying a need for clarity on the cylinder's definition.
  • A different approach is proposed, where participants are encouraged to write an equation that defines the cylinder and check if the point satisfies it as an inequality.
  • One participant emphasizes the importance of knowing how the cylinder is defined, especially if different coordinate systems are involved, and suggests using parametric equations for the cylinder's center line.
  • A more complex method is introduced, involving the calculation of the distance from the point to the line defined by the cylinder's axis, including the minimization of this distance to determine the point's position relative to the cylinder's radius.

Areas of Agreement / Disagreement

Participants express differing views on the definition and approach to determining if a point is inside the cylinder. There is no consensus on a single method, and the discussion reflects multiple competing perspectives and approaches.

Contextual Notes

Participants highlight the need for clarity on the cylinder's definition and the implications of different coordinate systems. Some methods rely on specific assumptions about the cylinder's orientation and mathematical representation.

willworkforfood
Messages
54
Reaction score
0
Defining the right circular cylinder, I have a vector formed between the centers of each 'cap' and a radius.

I need to determine if a given point (x,y,z) is inside the confines of this cylinder. And and all help is appreciated.
 
Mathematics news on Phys.org
If it's aligned with the axes, this is easy. Say the circular face is on the x and y axes with the height on the z axis. Check the two-dimensional distance from the center of the cylinder to (x, y). If it's greater than the radius, it's outside; if less, continue. (If equal then continue, but note that if the second test passes it's actually on the border rather than being inside.) For the second, compare the bottom and top z-coordinates of the cylinder to z. If z is between the two it's inside; if equal to one of the two it's on the boundary; if outside the two it's outside.
 
CRGreathouse said:
If it's aligned with the axes, this is easy. Say the circular face is on the x and y axes with the height on the z axis. Check the two-dimensional distance from the center of the cylinder to (x, y). If it's greater than the radius, it's outside; if less, continue. (If equal then continue, but note that if the second test passes it's actually on the border rather than being inside.) For the second, compare the bottom and top z-coordinates of the cylinder to z. If z is between the two it's inside; if equal to one of the two it's on the boundary; if outside the two it's outside.

It is not defined on the axes :(
 
write the equation that defines the cylinder as an equality/inequality, plug in point and see if satisfies it.
 
willworkforfood said:
It is not defined on the axes :(

Then I'd have to know how it's defined to answer that. If you have two systems of axes, you need to convert between them; if you have a parametric equation to define the cylinder, just check if it holds as an inequality.
 
If the points at the centers of the caps are (ax,ay,az) and (bx,by,bz), you can write a parametric equation for the center line as x(t) = ax + t (bx-ax), y(t) = ay + t (by-ay), z(t) = az + t (bz-az), where t=0 or 1 will give you back the cap points.

The distance from a given point (px,py,pz) to any point in the line is given by the function d(t) = sqrt ( (x(t)-px)^2 + (y(t)-py)^2 + (z(t)-pz)^2 ). The closest point on the line (the proyection of your point onto the line) is found by minimizing d, that is, by setting d'(t) = 0 and solving for t. (You could do it by hand, using a math package, or using www.quickmath.com, menus Calculus/Differentiate and Equations/Solve).

Now, with the obtained t_min value, you can: (a) determine if t_min is <0 or >1 (or <=, >= to exclude the border), which would mean the given point was below one cap or above the other; and (b) calculate d(t_min), the distance from the line to your point, that will tell you if the point is farther than the cylinder's radius.

Edit:
Here, I was bored. (C source only.)
 

Attachments

Last edited:

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
0
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
22
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K