|
I am looking for efficent algorithm for checking if one point is nearby another in 3D.
sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2) < radius
This doesn't seem to be too fast and actually I don't need such a big accuracy. How else could I do this?
Started by Balon on
, 11 posts
by 11 people.
Answer Snippets (Read the full thread at stackoverflow):
Not need big accuracy maybe you can check if 2nd point is inside cube (side length '2a'), not sphere with objects on a "ground" x-y plane then check the z axis last, as you should be able to rule out collisions earlier by using the....
|
|
Hi
This is related to this question
I have a vector of points that will, for instance, store 100K+ points.
std::vector<Point> point_vec;
I want to check if a position (x, y, z) to be added is already in point_vec (represented by an instance of class...
Started by memC on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
If the former, a std:;set of points will be fast to determine if a point is already there, and will maintain.
|
|
I've got a right triangle and I want to check if a given point is on the Hypotenuse of that triangle. All points are plain integers, not floating-point variables.
Edit: All green squares would be on the hypotenuse, the white squares not. I know x, y, ...
Started by raphaelr on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If you now get a point....
Example it would be y = 5x/12.
For the vertical case, you just check if the point in question has a y value in the range check if the point's y is within some small delta of (m * x + b).
It is not.
|
Ask your Facebook Friends
|
If I have two rectangles whose positions are deifned using two 2D vectors (i.e. top left, bottom right) how can I check for the points they are intersecting?
Started by meds on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Let the first rectable be {T1, L1, B1, R1} and the second {T2 more to a function to do the job, than to implement... .
Assuming the origin is on left-top of the screen
If Check if the the top left of one rectangle interior point X,Y common to both.
|
|
Hello, i have the following geometrical issue in 2D:
i have a point from which i cast an infinite angle (2D-cone) which is given by a direction and an angle. (the point and the direction form a vector and to each side half of the angle forms the 2D-cone...
Started by matt on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Substract ....
Calculate the angle of the direction using arctg of the direction .
This works in 2D and 3D.
Normalize the vector, then point in question is inside the cone.
Calculate the vector from the center of the cone to the query point.
|
|
Hello. I have a program in C# (Windows Forms) which draws some rectangles on a picturebox. They can be drawn at an angle too (rotated).
I know each of the rectangles' start point (upper-left corner), their size(width+height) and their angle. Because of...
Answer Snippets (Read the full thread at stackoverflow):
To the point in reverse?
For example, Rectangle A is rotated 45 degrees clockwise from its origin (upper left corner), you would then just rotate point B around the same origin 45 degrees COUNTER clockwise, then check to see if it....
|
|
I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original folder with a symlink to the...
Started by nickf on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Consider that you.
There isn't really any direct way to check for such symlinks.
It's an absolute path.
|
|
I need to play PowerPoint slides but first I want to check whether PowerPoint or viewer is installed on the machine or not. How can I do that using .NET?
Started by Firoz on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
To check whether there is an associated handler for ppt files, you; } else { return false; } } if (....
It depends on whether access the PowerPoint object model.
Exists or not by using "Exists Method" from system.io namespace?
Check this .
|
|
Possible Duplicate:
What does <if __name__==”__main__”:> do?
I occasionally notice something like the following in Python scripts:
if __name__ == "__main__": # do stuff like call main()
What's the point of this?
Started by BipedalShark on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
If you did not have this check, any code that was not in a class or function would run.
From the file.
|
|
My function is pretty much a standard search function... I've included it below.
In the function I have 1 line of code responsible for weeding out Repart NTFS points.
if (attributes.ToString().IndexOf("ReparsePoint") == -1)
The problem is now I am getting...
Started by Michael L on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I'm not sure what the answer to the question is, but please change your attribute check to use.
|