How Do 3D Coordinates and Radii Affect Vector Paths Between Points?

In summary, the conversation is about a computational problem involving a collection of 3D coordinates and radii, where the goal is to determine which connecting line segments do not intersect with the spheres around any other vertices. The suggested approach involves checking the location and radius of a third point in relation to the two endpoints of the line segment. The conversation also mentions possible applications in gaming and a proposed formula for solving the problem.
  • #1
ckirmser
105
3
I'm not sure if this is the right forum - please move the thread, if not - but, here goes...

I have a collection of 3d coordinates, each with a radius of varying amounts. Each of the coordinates is to be linked to each of the others, unless a third coordinate - with its radius - blocks the straight line path between the first two.

I'm thinking of an adjacency table where the intersection of the X, Y lines would be the length of an unbroken vector between the two points.

Any ideas?

Thanx in advance for any help!
 
Mathematics news on Phys.org
  • #2
Re-wording so that the problem makes sense to me...

You have a collection of vertices specified as coordinate 3-tuples. Around each vertex you have a sphere of some radius. The radius of the sphere can be different for each vertex. Links (line segments) are to be drawn between each pair of vertices but only if those line segments do not intersect with the spheres around any other vertices.

You are after a computational approach that will allow you to determine which connecting line segments meet this criterion and which do not?
 
  • #3
You have it spot on.

I'd like to take my table of coordinates, run the computational process and have a resulting adjacency table of those coordinates with surviving links. It'd also be nice if the table showed the length of each link.

I was never the best with matrix operations it's been years, anyway.
 
  • #4
Given two points, can you code up a test to see whether the line connecting those two intersects with the sphere of given radius around a given point?
 
  • #5
My idea would be to see if the third point lies on the line formed by the first two. But, what throws me is including the radius.

I didn't know if maybe this might be a common problem - say, in gaming - that may already have a formula I didn't know about.
 
  • #6
ckirmser said:
My idea would be to see if the third point lies on the line formed by the first two. But, what throws me is including the radius.

I didn't know if maybe this might be a common problem - say, in gaming - that may already have a formula I didn't know about.
Possibly there is a better approach, but...

Call the points at the ends of the line segment a and b. Call the third point c. Call its radius r.

Define one plane that is perpendicular to line ab at point a. Call this plane A. Define a second plane that is perpendicular at point b. Call this plane B. There are three immediately obvious conditions for point c. It can lie between the planes, on the "a" side of both planes or on the "b" side of both planes.

To determine which, take the dot product of ab and ac. If the product is positive, c is on the b side of plane A. If negative, it is on the a side. Similarly, take the dot product of ba and bc to determine which side of plane B point c is on.

If point c is on the a side of both planes then it suffices to check whether point a falls within radius r of point c. Similarly, if point c is on the b side of both planes, it suffices to check whether point b falls within radius r of point c. The more difficult case is when point c falls between planes A and B.

Compute the distance from point c to line ab. This is the length of the projection of ca on plane A (or, equivalently, the projection of cb on plane B). One way to compute this would be as the vector cross product of ca and ba and divide by the length of ba.

Compare the computed distance to r. If it is greater than r, then the sphere around c does not intersect line ab. If it is less than r then the sphere does intersect line ab. And because we know that point c is between planes A and B, we can easily see that the intersection includes at least a portion of line segment ab.
 
  • Like
Likes jim mcnamara
  • #7
jbriggs444 said:
Possibly there is a better approach, but...

Call the points at the ends of the line segment a and b. Call the third point c. Call its radius r.

Define one plane that is perpendicular to line ab at point a. Call this plane A. Define a second plane that is perpendicular at point b. Call this plane B. There are three immediately obvious conditions for point c. It can lie between the planes, on the "a" side of both planes or on the "b" side of both planes.

To determine which, take the dot product of ab and ac. If the product is positive, c is on the b side of plane A. If negative, it is on the a side. Similarly, take the dot product of ba and bc to determine which side of plane B point c is on.

If point c is on the a side of both planes then it suffices to check whether point a falls within radius r of point c. Similarly, if point c is on the b side of both planes, it suffices to check whether point b falls within radius r of point c. The more difficult case is when point c falls between planes A and B.

Compute the distance from point c to line ab. This is the length of the projection of ca on plane A (or, equivalently, the projection of cb on plane B). One way to compute this would be as the vector cross product of ca and ba and divide by the length of ba.

Compare the computed distance to r. If it is greater than r, then the sphere around c does not intersect line ab. If it is less than r then the sphere does intersect line ab. And because we know that point c is between planes A and B, we can easily see that the intersection includes at least a portion of line segment ab.
Hmm.

Matrix operations, it looks like. I'll have to cogitate on your answer for a while to distill it from words into a formula. My poor old brain hasn't done this sort of thing since the 80s.

Thanx for the reply, kind sirrah; from first glance, it looks like what I'm after, but getting what I need out of it will take some work on my part.
 
  • #8
In doing more research, I'm finding that the line equation isn't a simple thing like y = mx + b.

Oh no no no.

This is going to be a tough nut to crack. Mainly because most of what I'm finding on figuring the line equation connecting two 3d points looks to require some prior knowledge. Maybe I had that knowledge back in college, but that was over 20 years ago; it's covered under thick, impenetrable layers of brain dust now.
 
  • #9
Here's a thought.

  1. For every ordered triple in space, find the plane it lies in by converting three points to two vectors and take the cross-product which is the normal vector
  2. Substitute any of the three points and use the normal vector to solve for the equation of the plane in space.
  3. Translate the plane and points in space to two dimensional plane and use simple planar geometry techniques
  4. At this point, all you have to do is find a line perpendicular (radius) to a line segment (the end points that might intersect the sphere).
  5. Use the distance formula to see if the contained point and the point of intersection in the line exceeds the radius
 
Last edited:

Related to How Do 3D Coordinates and Radii Affect Vector Paths Between Points?

1. What is a vector impacting a sphere?

A vector impacting a sphere refers to a physical force or motion that is applied to a spherical object in a specific direction. It can be described by its magnitude, direction, and point of application.

2. How does a vector impact a sphere?

A vector impacts a sphere by changing its state of motion or causing it to deform. The impact can be determined by the magnitude and direction of the vector, as well as the properties of the sphere such as its mass, density, and material composition.

3. What are the effects of a vector impacting a sphere?

The effects of a vector impacting a sphere depend on the magnitude and direction of the vector, as well as the properties of the sphere. It can result in a change in velocity, acceleration, or deformation of the sphere.

4. How is the impact of a vector on a sphere calculated?

The impact of a vector on a sphere can be calculated using principles of mechanics and physics, such as Newton's laws of motion. The magnitude and direction of the vector, as well as the properties of the sphere, are taken into account to determine the impact.

5. What are some real-life examples of a vector impacting a sphere?

Some real-life examples of a vector impacting a sphere include a basketball being thrown into a hoop, a bowling ball hitting pins, or a meteor crashing into the Earth's surface. These scenarios involve a force being applied to a spherical object, resulting in an impact with observable effects.

Similar threads

Replies
2
Views
1K
  • General Math
Replies
3
Views
2K
Replies
3
Views
748
Replies
20
Views
3K
Replies
1
Views
889
Replies
3
Views
1K
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
20
Views
2K
  • Special and General Relativity
Replies
10
Views
3K
Replies
2
Views
1K
Back
Top